U9 Topic 3 Flashcards

1
Q

What are regular expressions

A

Patterns used to specify a set of strings

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

What are regular expressions used for

A

Finding particular words in a stream
Defining a set of acceptable strings in a language

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

How can this set be described
S = {a, ab, abb, abbb, …}

A

S = ab*

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

NOTATION -
* l *

A

Separates alternatives (or, V)

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

NOTATION -
* * *

A

Indicates there are 0 or more of the preceding element

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

NOTATION -
* + *

A

Indicates there are 1 or more of the preceding element

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

NOTATION -
* ? *

A

Indicates there are 0 or 1 of the preceding element

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

NOTATION -
* ( ) *

A

Used to identify Groupings

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

TRANSLATE -
a^+b^+

A

1 or more a and 1 or more b

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

TRANSLATE -
a^*b

A

0 or more a and b

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

TRANSLATE -
(a?b) l (ba^+)

A

1 group of 0 or 1 a and b, OR 1 group of, b and 1 or more a

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

DEFINE -
a “01” pair repeated any number of times

A

(01)^+

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

DEFINE -
One or more 0s bounded on either end by a single 1

A

10^+1

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

DEFINE -
S = {10, 100, 1000, … 01, 011, 0111, …}

A

10^+ l 01^+

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