in reply to Reg Exp

YAPE::Regex::Explain can help:
use strict; use warnings; use YAPE::Regex::Explain; print YAPE::Regex::Explain->new('[[\\s(/]ssshd\\s')->explain(); __END__ The regular expression: (?-imsx:[[\s(/]ssshd\s) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- [[\s(/] any character of: '[', whitespace (\n, \r, \t, \f, and " "), '(', '/' ---------------------------------------------------------------------- ssshd 'ssshd' ---------------------------------------------------------------------- \s whitespace (\n, \r, \t, \f, and " ") ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------

Replies are listed 'Best First'.
Re^2: Reg Exp
by kennethk (Abbot) on Aug 27, 2010 at 19:54 UTC
    This points out an interesting issue with how the OP formatted his post. Because you fed YAPE::Regex::Explain a single-quote constructed string, it saw a whitespace character, whereas when I assumed the OP had wrapped the expression directly in m<...> I expected a backslash or an 's' in the class. I think your result is likely more logical.