in reply to Reg Exp

In general, most questions you might have about regular expressions can be found in perlre or perlretut.

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

    I would like to echo the first paragraph of the above post.   And please don’t treat it as an “RTFM!” brush-off, because it is not.

    perldoc pages are generally very well-written, and there are a great many of them which discuss regular expressions.   Some of them take a while to read, but it is time very well spent.   Regular expressions are one of the core power-tools of Perl, and these pages are the first and the best place to begin learning about them.