feetslashbirds has asked for the wisdom of the Perl Monks concerning the following question:
The idea is to get the regex to grab each [] pair one at a time but instead the first pass grabs everything up to the ending }]] Help me perl monks, you are my only hope#counter is equal to the number of [] pairs while($counter) { if($content =~ /\[{(.*)?}\](.+)/) { print OUT "$counter\n"; print OUT "$1\n"; $content = $2; } #}]], "plt": --$counter; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non Greedy?
by zwon (Abbot) on Jun 02, 2009 at 21:48 UTC | |
by feetslashbirds (Initiate) on Jun 02, 2009 at 22:16 UTC | |
|
Re: Non Greedy?
by ikegami (Patriarch) on Jun 02, 2009 at 21:53 UTC | |
|
Re: Non Greedy?
by carlin (Beadle) on Jun 02, 2009 at 21:51 UTC | |
|
Re: Non Greedy?
by citromatik (Curate) on Jun 02, 2009 at 23:54 UTC | |
|
Re: Non Greedy?
by Devasundaram (Initiate) on Jun 03, 2009 at 07:50 UTC |