Regular Expressions Flashcards

1
Q

what are regular expressions

A

a way of descfribing a set that allows particular types of languages to be described in a shorthand notation

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

what does the following symbol mean

a

A

a symbol has to be used

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

what does the following symbol mean

*

A

0 or more repetitions

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

what does the following symbol mean

+

A

1 or more repititions

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

what does the following symbol mean

?

A

0 or 1 repititions (optional)

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

what does the following symbol mean

|

A

or

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

what does the following symbol mean

()

A

groups regular expressions

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

what does the following symbol mean

[abc]

A

a or b or c

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

what does the following symbol mean

[^jkl]

A

any character except j, k or l

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

what does the following symbol mean

[a-z]

A

any character in lowercase

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

write a list of some valid inputs for a(a|b)

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

True or False

the set of strings defined by a regular language is always finite in size

A

False

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

write a regular expression that matches either clare or claire

A

clai?re

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

write a regular expression that matches

  • starts with 10
  • has zero or more occurences of any combination of 0 or 1 in the middle
  • ends with 01
A

10(0|1)*01

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