in reply to Reg Exp
In regular expressions, square brackets indicate character classes. In this case you will match on any of the following list of characters:
[ \ s ( /
I'm actually a little surprised that the regular expression engine doesn't throw an error on an unescaped open square bracket in a character class, but it seems to have no problem parsing it, so...
The rest of the expression just requires the literal string ssshd\s. Thus the following outputs 1:
print '(ssshd\s' =~ m<[[\\s(/]ssshd\\s>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reg Exp
by locked_user sundialsvc4 (Abbot) on Aug 30, 2010 at 15:53 UTC |