>perl -wMstrict -le "use YAPE::Regex::Explain; ;; my $rx = qr/^update\ (\w*)[^\s]/; print YAPE::Regex::Explain->new($rx)->explain; " The regular expression: (?-imsx:^update\ (\w*)[^\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): ---------------------------------------------------------------------- ^ the beginning of the string ---------------------------------------------------------------------- update 'update' ---------------------------------------------------------------------- \ ' ' ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- \w* word characters (a-z, A-Z, 0-9, _) (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \1 ---------------------------------------------------------------------- [^\s] any character except: whitespace (\n, \r, \t, \f, and " ") ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------