Ordinary characters consist of all characters that are not explicitly designated as meta characters. This includes:
- all upper- and lowercase alphabetic characters,
- all digits,
- all punctuation marks,
- some symbols.
The simplest form of a Regular Expression is a single, ordinary character that matches itself in a searched string. For example, the single-character pattern
/a/matches the letter a wherever it appears in the searched string.
You can combine a number of single characters together to form a larger expression.
/arm/This expression describes a pattern with these three characters joined together. Note that there is no concatenation operator. All that is required is that you put one character after another.
The match will be found in the string
"Those people are harmless."but not in the string
"Those people are my family."Even though the second string has the characters a, r and m, they are not joined together, so no match is found.