Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: RE greediness

by Anonymous Monk
on May 29, 2024 at 20:46 UTC ( [id://11159723]=note: print w/replies, xml ) Need Help??


in reply to Re^2: RE greediness
in thread RE greediness

    (?:...) is a non-capturing group, positive lookahead uses (?=...) which I can't find in the regex used.
Sorry for the typo, meant to type this, but it's still wrong:
/(a)(?=(.*?)(?:b=(\w)))?/
This seems to work:
/(a)(.*?)(?=b=(\w)|\z)/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-09-18 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (24 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.