An Introduction to Regular Expressions The Basics 18 of 50 : [PREV] [NEXT]

Standard Meta Characters

Grouping, Capturing & Constraining

  • (...) - Match & capture pattern
  • (?:...) - Match pattern (no capture)
  • (?=...) - Positive lookahead (no capture)
  • (?!...) - Negative lookahead (no capture)

Examples:

Birmingham(?= Perl Mongers) - Only match Birmingham Perl Mongers
Birmingham(?!, Alabama) - Wont match Birmingham, Alabama

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