An Introduction to Regular Expressions The Match Operator 25 of 50 : [PREV] [NEXT]

Usage

Take a look at the following regular expressions (patterns):

m/abc/
/abc/
m^abc^

Regular expressions are normally delimited by forward slashes. In Perl you can use m@ and @ as delimiters, where @ can be any non-alphanumeric, non-whitespace character. The m is optional if you use forward slashes.

The above regexp matches any one of the following strings:

"abcdef"
"defabc"
".=.abc.=."

But doesn't match any of these:

"fedcba"
"ab c"
"JavaScript"

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