[prev] [index] [next]

Atomic Patterns

The POSIX regular expression language allows you to build up complex patterns from simple components using pattern constructors.

Atomic patterns are denoted by single characters:

  • lower-case letters, upper-case letters, digits, some punctuation
An atomic pattern matches a literal example of itself anywhere in the input.

E.g. the pattern a matches the letter a anywhere in the input.

Some punctuation characters (e.g. * [ ^) have special meanings, but can also be used as atomic patterns by escaping them with \ (backslash).

E.g. the pattern \* matches the * character anywhere in the input.

The special pattern . (dot) matches any single character.