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

Re^5: How to enforce match priority irrespective of string position

by eyepopslikeamosquito (Archbishop)
on Mar 08, 2021 at 03:30 UTC ( [id://11129310]=note: print w/replies, xml ) Need Help??


in reply to Re^4: How to enforce match priority irrespective of string position
in thread How to enforce match priority irrespective of string position

This reference explains it quite well:

lookaround actually matches characters, but then gives up the match, returning only the result: match or no match. That is why they are called “assertions”. They do not consume characters in the string, but only assert whether a match is possible or not.

... most regex flavors do not allow you to use just any regex inside a lookbehind, because they cannot apply a regular expression backwards. The regular expression engine needs to be able to figure out how many characters to step back before checking the lookbehind.

Hope that helps.

  • Comment on Re^5: How to enforce match priority irrespective of string position

Log In?
Username:
Password:

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

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

    No recent polls found