Regular Expressions
Learn how to define and manipulate regular expressions as patterns representing languages in automata theory. Understand the operations of union, concatenation, and Kleene star, and how regular expressions relate to finite automata and regular grammars. Gain skills to construct and simplify expressions for textual pattern matching.
We'll cover the following...
Regular expressions are a convenient notation for representing strings that match simple text patterns. The expression illustrates two of the four regular expression operations, namely concatenation (via juxtaposition) and Kleene star. The others appear in the following recursive definition.
Formal definition
-
These are regular expressions:
a) , representing the empty language/set,
b) , representing the one-string language/set,
c) , for each character, in the alphabet , representing the language/set
-
For regular expressions , the following are also regular expressions:
a) ...