1) Regular Expressions and Languages Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Regular Expressions

A

Regular expressions are patterns used to specify a set of strings.
They are used for;
- Finding particular words in a stream
- Finding combinations of characters in strings

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

Set and Notation Precedence

A

S can be defined by a regular expression ab*
S = {a, ab, abb, abbb}
| - Separates alternatives
* - Indicates that there are 0 or more of the preceding element.
+ - Indicated there is 1 or more of the preceding element.
? - Indicates that there are 0 or 1 of the preceding element.
( ) - used to identify groupings

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

What is a set?

A

A set is a well-defined collection of objects, objects in s set are called elements.
A set is unordered and each element can only occur once.
Common Sets:
N = Natural Number {0, 1, 2,…}
Z+ = Positive Integer {1, 2, 3,…}
Z = all integers {…, -2, -1, 0, 1, 2, …}
Q = rational numbers { number expressed as a fraction}
R = real numbers { Numbers that contain a decimal place}

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