[Israel.pm] Regex question: alternation between a delimiter andEOL

Yossi Itzkovich Yossi.Itzkovich at ecitele.com
Wed Jan 24 04:53:55 PST 2007


  :-)

It didn't work in my script, but I see that the pattern I sent indeed
works !
Thanks for your help (and Gaal's)

Yossi

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Ephraim Dan
Sent: Wednesday, January 24, 2007 2:43 PM
To: Perl in Israel
Subject: Re: [Israel.pm] Regex question: alternation between a delimiter
andEOL


Yossi writes:
I can't do something like:
/key=(.+?)(;|$)/
although I'd like too...

[edan] Why not?  Works fine.  Might not be the best regexp (better to
use /key=([^;]+)(;|$)/g), but what you wrote works fine (assuming you
want to capture the values only, despite saying you want to capture the
key=value pairs, but I assume that's not your issue).  

What problem are you having with the regexp you wrote?

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list