vladb has asked for the wisdom of the Perl Monks concerning the following question:
and split it into this:Foo bar <tag>#var#as</tag> rules.
Foo bar <tag> #var# as </tag> rules
perl -MData::Dumper -e '@t= split(/(?=<)|(?=#[^#]+#)/,"Foo bar <cfoutp +ut>#var#as</cfoutput>"); print Dumper(\@t);'
$VAR1 = [ 'Foo bar ', '<cfoutput>', '#var#as', '</cfoutput>' ];
| "There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help: 'Complex' split
by merlyn (Sage) on Dec 26, 2001 at 22:03 UTC | |
by vladb (Vicar) on Dec 26, 2001 at 22:07 UTC |