On May 6, Jeff Pinyan said:
>On May 7, Clinton said:
>
>>I'm tring to extract some values delimited by quotes
>>I can extract the first set using "([^"]*) but not the second set using
>>"([^"]*),"([^"]*). Could I have a clue please?
>
>If you download YAPE::Regex 3.00 and YAPE::Regex::Explain 3.01 from CPAN
>or my web site (click on the YAPE link in "Projects"), then you can use
>the regex explainer program (called 'explain') to get an explanation of
>your regex, which should help you see why it's failing.
Sample explain output:
The regular expression:
(?-imsx:"([^"]*),"([^"]*))
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):
----------------------------------------------------------------------
" '"'
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
[^"]* any character except: '"' (0 or more
times (matching the most amount
possible))
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
," ',"'
----------------------------------------------------------------------
( group and capture to \2:
----------------------------------------------------------------------
[^"]* any character except: '"' (0 or more
times (matching the most amount
possible))
----------------------------------------------------------------------
) end of \2
----------------------------------------------------------------------
) 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