Examples:

  • .at matches any three-character string ending with “at”, including “hat”, “cat”, and “bat”.
  • [hc]at matches “hat” and “cat”.
  • [^b]at matches all strings matched by .at except “bat”.
  • [^hc]at matches all strings matched by .at other than “hat” and “cat”.
  • ^[hc]at matches “hat” and “cat”, but only at the beginning of the string or line.
  • [hc]at$ matches “hat” and “cat”, but only at the end of the string or line.
  • \[.\] matches any single character surrounded by “[” and “]” since the brackets are escaped, for example: “[a]” and “[b]”.
  • s.* matches any number of characters preceded by s, for example: “saw” and “seed”.

regexp1 regexp2

regex simulator: http://regex.lumadis.be/test_regex.php?lang=fr

tutorials about regexp:

http://en.wikipedia.org/wiki/Regular_expression

http://www.regular-expressions.info/quickstart.html

http://www.expreg.com/