Section 9 Chapter 52 - Regular Expressions Flashcards
1
Q
|
A
OR
2
Q
?
A
Optional (preceding element)
3
Q
*
A
zero or more (preceding element)
4
Q
+
A
one or more (preceding element)
5
Q
Regular Expression
A
A simple way to describe a set
6
Q
Regular expression for a 0 followed by any binary string
A
0(0|1)+
7
Q
Common uses of regular expressions (3)
A
- To match patterns to text files
- By compilers to recognise syntax
- By programs to validate input
8
Q
Regular language
A
A language that can be represented with a regular expression (or a FSM)
9
Q
Relationship between regular expressions and FSM
A
They are equivalent ways of describing a regular language