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

Re: Regex for outside of brackets

by Anonymous Monk
on Jul 13, 2018 at 11:58 UTC ( [id://1218440]=note: print w/replies, xml ) Need Help??


in reply to Regex for outside of brackets

Another way to do it would be to apply a regex repeatedly to the string, a regex which looks for a balanced-parentheses group. Note the substring-position where that pattern begins, and calculate where it ends. Iterate through the loop, extracting the appropriate substrings given their now-known starting and ending positions. Source-code to do it left as an exercise for the reader.

Replies are listed 'Best First'.
Re^2: Regex for outside of brackets
by Your Mother (Archbishop) on Jul 13, 2018 at 13:39 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found