Regular Expressions
Basic Patterns

  • Regular expressions by example...

      Meta-Characters Example Matches
      / ... / /a/ Any "a"
      . /a./ An "a" followed by any character
      * /ab*c/ An "a", then 0 or more "b's", then a "c"
      + /ab+c/ An "a", then 1 or more "b's", then a "c"
      [ ... ] /[ab]/ An "a" or a "b"
      - /[a-z]/ An "a" or "b" or "c" ... or "z"
      ^ /[^a-z]/ Any character except "a-z"
      ^ /^ace/ Begins with "ace"
      $ /ace$/ Ends with "ace"