正規表現 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

一致する

A

=~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

一致しない

A

!~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

a b cとマッチ

A

[abc]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

abcdefg..zとマッチ

A

[a-z]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

abcdefg..z ABC..Zとマッチ

A

[a-zA-Z]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

a以外の文字

A

[^a]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

文字列の先頭

A

\A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

文字列の末尾 \nでマッチ

A

\Z

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

文字列の末尾 \nではマッチされない

A

\z

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

文字列の行頭 単語の先頭 !!文字列の途中でもマッチする!!

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

文字列の末尾 単語の末尾 !!文字列の途中でもマッチする!!

A

$

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

1文字

A

.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

スペース

A

\s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

スペース以外

A

\S

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

数字

A

\d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

\d以外

A

\D

17
Q

英数字と_ [0-9a-zA-Z_] 日本語1文字

A

\w

18
Q

単語の境界

A

\b

19
Q

単語の一部

A

\B

20
Q

正規表現のグルーピング Capture

A

(…)

21
Q

a or b

A

(a|b)

22
Q

直前の正規表現と0回以上マッチ

A

a*

23
Q

0回(なし)か1回マッチ

A

a?

24
Q

1回以上マッチ

A

a+

25
Q

3回繰り返し時にマッチ

A

a{3}

26
Q

3回以上繰り返しにマッチ

A

a{3,}

27
Q

3回以上 6回以下マッチ

A

a{3,6}

28
Q

0回以上マッチ(最短一致)

A

a*?

29
Q

1回以上マッチ(最短一致)

A

a+?