perl -MYAPE::Regex::Explain -e " print YAPE::Regex::Explain->new(qr/$A +RGV[0]/)->explain();" ^\s*[^\s\*=]+\s*= The regular expression: (?-imsx:\s*[\s\*=]+\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* whitespace (\n, \r, \t, \f, and " ") (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- [\s\*=]+ any character of: whitespace (\n, \r, \t, \f, and " "), '\*', '=' (1 or more times (matching the most amount possible)) ---------------------------------------------------------------------- \s* whitespace (\n, \r, \t, \f, and " ") (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- = '=' ---------------------------------------------------------------------- ) end of grouping ---------------------------------------------------------------------- perl -MYAPE::Regex::Explain -e " print YAPE::Regex::Explain->new(qr/$A +RGV[0]/)->explain();" ^\s*\w+\s*= The regular expression: (?-imsx:\s*\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): ---------------------------------------------------------------------- \s* whitespace (\n, \r, \t, \f, and " ") (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) ---------------------------------------------------------------------- \s* whitespace (\n, \r, \t, \f, and " ") (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- = '=' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
In reply to Re: Understanding Regex
by Discipulus
in thread Understanding Regex
by hareesh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |