Regular expressions Flashcards

1
Q

[…] vs [^…]

A

[…] = any 1 char between brackets
[^…] = any 1 characyter NOT between brackets

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

.

A

Any character except new line = [^\n]

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

{ n,m}

A

match previous item at least n times but no more than m times

no max = { n,}

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

?

A

zero or 1 occurence of the previous item = {0,1}

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

+

A

matches 1 or more occurence of previous item

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

*

A

Match sero of more occurrence of the previous item = {0,}

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

case insensitive

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

-g

A

don’t stop after 1st matching

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

|

A

match either right or left

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

^ and $

A

^ = match beginning of string
$ = match end of the string

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