[thelist] regexp help

Richard Bennett richard.bennett at skynet.be
Mon Jul 14 11:13:41 CDT 2003


Hi,
I have a long string that I'm parsing in Perl, like this:

 11 aaa| 2355 bbbb| 04 aff gge|...

When I search for 04 I want to get the value 'aff gge' in a variable

So far I'm trying like this, but it's not returning the correct string:

if($string=~/04(.*?)\|/gi){
    $substring=$1;
}

Any ideas?

Richard.


More information about the thelist mailing list