Topic 9 - Regular Expressions Flashcards

1
Q

”.”

A

matches any single character except newline

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

“*”

A

matches zero or more occurrence of the previous single character

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

\ (backslash)

A

escape character

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

^ (caret)

A

matches the beginning of a line

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

$

A

matches the end of a line

do not use $ with double quotes - problems with the shell

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

[…]

A
  • matches a single character in a set or range of characters

- combine […] with * to match repeated sets

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

[^…]

A

matches the complement of whats inside the square brackets

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

\less-than-sign

A

matches the BEGINNING of a regular expression word

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

>

A

matches the END of a regex word

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

(….)

\n

A
  • remembers a portion of regular expression

- recalls the remembered portion where n is a digit from 1 to 9

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

X{m}

X{m,n}

A
  • matches exactly m repeated of the one character regular expression X
  • matches m to n repeats of X
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

X{m,}

A

matches m or more repeats of X

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

X{,m}

A

matches simply m or fewer repeats of X

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