Regex Flashcards

1
Q

.[{()*+?|^$

A

All characters match themselves except for these special characters.

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

Character match the start of a line.

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

$

A

Character match the end of a line.

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

(?:ab)+

A

Will repeat ‘ab’ without splitting out any separate sub-expressions.

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

*, +, ?, and {}

A

Repeats operators.

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

*

A

The operator will match the preceding atom zero or more times, for example the expression ab will match any of the following:

b
ab
aaaaaaaab

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

+

A

{1,}

The + operator will match the preceding atom one or more times, for example the expression a+b will match any of the following:
ab
aaaaaaaab but will not match: b

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

?

A

The ? operator will match the preceding atom zero or one times, for example the expression ca?b will match any of the following:
cb
cab

But will not match: caab

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

a{n}

A

Matches ‘a’ repeated exactly n times.

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

a{n,}

A

Matches ‘a’ repeated n or more times.

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

a{n, m}

A

Matches ‘a’ repeated between n and m times inclusive.

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