Any language has an 'alphabet': the valid characters making up 'words' in this language.
A notion expressing the rules governing the construction of a valid word in a language is known as a meta-language.
A regular language is any language that a finite state machine will accept. One example is a regular expression.
One of the most basic and important computer processing tasks is pattern-matching. This is important in areas like field validation for web forms,
Regular expression: A notation for defining all the valid strings of a formal language.
The alphabet of a language: {a, b, c}
Notations like (a|b)*
are used to show the valid words in the language.
Backus-Naur Form
For anything with a complex syntax, we'd use Backus-Naur form (instead of a regular expression). It's used to write lanugages with context-free grammar.
First, the meta-component is written using angle brackets. Next, the 'assignment' statement ::=
. Finally, a disjunct of combinations of literals and other meta-components.
<letter> ::= a|b|c|d| ...
<word> ::= <word><letter> | <letter>