Regular Expressions Flashcards
what are regular expressions
a way of descfribing a set that allows particular types of languages to be described in a shorthand notation
what does the following symbol mean
a
a symbol has to be used
what does the following symbol mean
*
0 or more repetitions
what does the following symbol mean
+
1 or more repititions
what does the following symbol mean
?
0 or 1 repititions (optional)
what does the following symbol mean
|
or
what does the following symbol mean
()
groups regular expressions
what does the following symbol mean
[abc]
a or b or c
what does the following symbol mean
[^jkl]
any character except j, k or l
what does the following symbol mean
[a-z]
any character in lowercase
write a list of some valid inputs for a(a|b)
- a
- aaaaaa
- ab
True or False
the set of strings defined by a regular language is always finite in size
False
write a regular expression that matches either clare or claire
clai?re
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
10(0|1)*01