Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: How to split line of text into array containing macros and non-macro text

by hazylife (Monk)
on Mar 26, 2014 at 11:13 UTC ( [id://1079804]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to split line of text into array containing macros and non-macro text
in thread How to split line of text into array containing macros and non-macro text

sub parse { my @fields = split /((?:<[^>]+>|{[^}]+})+)/, shift; shift @fields if $fields[0] eq ''; return @fields; }
  • Comment on Re^3: How to split line of text into array containing macros and non-macro text
  • Download Code

Replies are listed 'Best First'.
Re^4: How to split line of text into array containing macros and non-macro text
by bulrush (Scribe) on Mar 26, 2014 at 11:27 UTC
    Thank you, it worked! I forgot braces do not need to be escaped. I appreciate the examples, they help me learn. I'm more of a visual person.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1079804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found