Perl Code Question

Joel Meulenberg joelmeulenberg at yahoo.com
Tue Jan 11 11:00:47 CST 2000


> Yes, '^' matches the begining of a string - but not in THIS context.
> It is 
> some kind of "anything but" when used within the [] character list 
> brackets. Like [a-z] matches any character from a thru z, [^a-z]
> matches 
> anything but characters a-z. I gather it is supported from common
> regular 
> expression syntax.

Exactly.  From page 15 of the "perlre" man page:
 
You can specify a character class, by enclosing a list of characters
in [], which will match any one character from the list.  If the first
character after the "[" is "^", the class matches any character not in
the list.  Within a list, the "-" character is used to specify a
range, so that a-z represents all characters between "a" and "z",
inclusive.  If you want "-" itself to be a member of a class, put it
at the start or end of the list, or escape it with a backslash.

+Joel
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com



More information about the grand-rapids-pm-list mailing list