iradik has asked for the wisdom of the Perl Monks concerning the following question:
where (stuff) is just random crap which changes on each repeat and where the alternation of tarbar vs bar is random.foo(stuff)tarbarfoo(stuff)barfoo(stuff)tarbar
however,this code goes wrong when foo(stuff)bar is found in the pattern because it matches foo(stuff)bar as "foo(stuffbarfoostuff)tarbar". in other words, it loads (stuff)barfoo(stuff) into the list but.. i only want stuffs from foo(stuff)tarbarmy @array = ($string =~ /foo(.*?)tarbar/gso);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: repeating patterns 2
by Dominus (Parson) on Mar 30, 2001 at 20:31 UTC | |
by boo_radley (Parson) on Mar 30, 2001 at 20:36 UTC | |
(tye)Re: repeating patterns 2
by tye (Sage) on Mar 30, 2001 at 20:33 UTC | |
Re: repeating patterns 2
by arturo (Vicar) on Mar 30, 2001 at 20:43 UTC | |
Re: repeating patterns 2
by danger (Priest) on Mar 30, 2001 at 20:52 UTC | |
Re: repeating patterns 2
by mbond (Beadle) on Mar 30, 2001 at 22:15 UTC |