An Introduction to Regular Expressions Matching Rules 46 of 50 : [PREV] [NEXT]

Rule 6

Each atom matches according to its type. If the atom doesn't match, or doesn't allow a match of the rest of the regular expression, the Engine backtracks to Rule 5 and tries the next choice for the atom's quantity.

Atoms match according to the following types:

  • A regexp in parentheses, (...), matches whatever the regular expression, ..., matches under Rule 2.
  • A "." matches any character, so .*, for example, matches any number of don't-care characters.
  • A list of characters in square brackets (a character class) matches any one of the characters in the list.

© 2003 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/