4.4.2.3 Regular expressions and 4.4.2.4 Regular language Flashcards Preview

Computing Theory > 4.4.2.3 Regular expressions and 4.4.2.4 Regular language > Flashcards

Flashcards in 4.4.2.3 Regular expressions and 4.4.2.4 Regular language Deck (11)
Loading flashcards...
1
Q

What does [A-Z] / [0-9] mean?

A

exactly one instance of a capital letter

exactly one instance of 0-9

2
Q

What does + mean?

A

Matches between one and unlimited times

3
Q

What does * mean?

A

Matches between zero and unlimited times

4
Q

What does ? mean?

A

0 or 1 repetitions, ie optional

5
Q

What does | mean?

A

or

6
Q

What does \d or \s mean?

A

Any digit

any whitespace character

7
Q

What is the relationship between

regular expressions and FSMs.

A

Regular expressions and FSMs are equivalent

ways of defining a regular language.

8
Q

What is a regular language?

A

if it can be represented by a regular expression.

any language that a FSM will accept.

9
Q

What is a:
natural language
formal language ?

A

Natural - comprises of a set of words written and spoken by humans
Formal - Used for the precise definition of syntactically correct programs for a programming language
The alphabet is defined as a finite set of symbols
The rules of syntax define how to construct strings of the language out of symbols
It is not feasible to list all the strings. Instead Regular expressions are used.

10
Q

What is a regular expression?

A

expressing the language that a machine can use in a formal manner
They provide a means of identifying if a string of characters is allowed in a particular language

11
Q

What does n[^t] mean?

A

An n followed by a character that is not a t

Decks in Computing Theory Class (102):