Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: To not capture recursive group while collecting certain matches

by LanX (Saint)
on Nov 29, 2021 at 17:15 UTC ( [id://11139228]=note: print w/replies, xml ) Need Help??


in reply to To not capture recursive group while collecting certain matches

> clean from matched recursive ?

There are no "recursive" inner matches returned.

It's unclear what you want but the following demonstrates how to match only at the top level of a recursive match.

DB<173> x 'bla[[abc]]foo' =~ / ( \[ (?1)* \w* \] ) /xg; 0 '[[abc]]'

Not what you wanted?

Then see how (not) to ask a question

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re: To not capture recursive group while collecting certain matches
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found