Re: FW: Regular expression

2007-10-21 Thread Jenda Krynicky
From: "Sayed, Irfan (Irfan)" <[EMAIL PROTECTED]> > Can somebody please help me on following doubt. Question. You may doubt our ability to help you with your questions, but still what you have is a question, not a doubt. Please distinguish the two. > But still my doubt exist. How Perl knows

Re: FW: Regular expression

2007-10-21 Thread Dr.Ruud
patmarbidon schreef: > Can you try > if ( $projet =~ /^([EMAIL PROTECTED])@/ ) { >$provb = $1 > } > > You will collect all characters from the beginnning to the first '@'. > If The first character is a '@' you will obtain an empty string. > If the first character is a '@' and you want to exclu

Re: FW: Regular expression

2007-10-21 Thread patmarbidon
Can you try if ( $projet =~ /^([EMAIL PROTECTED])@/ ) { $provb = $1 } You will collect all characters from the beginnning to the first '@'. If The first character is a '@' you will obtain an empty string. If the first character is a '@' and you want to exclude this case use '^([EMAIL PROTECTED

FW: Regular expression

2007-10-21 Thread Sayed, Irfan (Irfan)
Can somebody please help me on following doubt. --Irfan. -Original Message- From: Sayed, Irfan (Irfan) Sent: Friday, October 19, 2007 4:49 PM To: 'Siva Prasad' Subject: RE: Regular expression But still my doubt exist. How Perl knows that it has to stop at the @ character As

FW: Regular expression question: non-greedy matches

2004-04-05 Thread Boris Shor
Thanks for writing. I get no warnings when I use (ActiveState Perl on Windows): use Strict; use Warnings; $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; while ($test =~ /Yea (.*?)x.*?(Nay (.*?)x)?/g) { print "$1\n"; print "$2\n"; } What I am looking for are pairs: $1