Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Regex for outside of brackets

by choroba (Cardinal)
on Jul 13, 2018 at 22:20 UTC ( [id://1218469]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex for outside of brackets
in thread Regex for outside of brackets

You can get the same output as in the second example by slightly modifying the substitution in the first example and calling it in a loop:
1 while s/\([^()]*\)//g;

To get the warnings, just check for remaining ( or ).

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^3: Regex for outside of brackets
by mr_mischief (Monsignor) on Jul 14, 2018 at 00:04 UTC

    My goal wasn't particularly to force them all to the same output. I'm yet to be sure what output OP wants beyond the single case of input. It was to demonstrate that there are multiple ways to do things, none of which are a single regular expression match. Thanks for helping expand on that.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-18 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found