On May 15, Liger-dc said:
>What does the following formatting do?
>
>$line =~ /^; .ot (\d+)/)
I suggest you download YAPE::Regex and YAPE::Regex::Explain from CPAN --
the 'explain' program automatically generates an explanation for a regex:
friday:~ $ echo '^; .ot (\d+)' | explain
The regular expression:
(?-imsx:^; .ot (\d+))
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
----------------------------------------------------------------------
; '; '
----------------------------------------------------------------------
. any character except \n
----------------------------------------------------------------------
ot 'ot '
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734