in reply to REGEX Match Single Digit
use strict; use warnings; use YAPE::Regex::Explain; print YAPE::Regex::Explain->new('^\d[1]{1}$')->explain(); __END__ The regular expression: (?-imsx:^\d[1]{1}$) 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 ---------------------------------------------------------------------- \d digits (0-9) ---------------------------------------------------------------------- [1]{1} any character of: '1' (1 times) ---------------------------------------------------------------------- $ before an optional \n, and the end of the string ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: REGEX Match Single Digit
by spickles (Scribe) on Aug 28, 2009 at 16:10 UTC | |
by ww (Archbishop) on Aug 28, 2009 at 20:48 UTC | |
by ikegami (Patriarch) on Aug 28, 2009 at 16:12 UTC |