Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Text::Balanced not extracting

by kcott (Archbishop)
on Oct 16, 2010 at 22:52 UTC ( [id://865745]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Text::Balanced not extracting
in thread Text::Balanced not extracting

I haven't used this module before today so I can't offer any deep insight into the ways things have been set up.

I did wonder (exactly as you have) why it's set up like this.

I've just successfully tried the following:

my ($extracted,$remainder) = extract_bracketed($text,'()', ($text =~  m{ \A ( [^(]+ ) }msx)[0]);

You might choose to use something like that in all cases that might have an unknown prefix.

I haven't checked out the solution below (by Khen1950fx) - that may be preferable.

-- Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-20 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found