Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Greedy modifier found to be working non-greedy in a named group

by rsFalse (Chaplain)
on Nov 30, 2019 at 15:05 UTC ( [id://11109482]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Greedy modifier found to be working non-greedy in a named group
in thread Greedy modifier found to be working non-greedy in a named group

> ...and that e* means e{0}|e+ ( or something like e{0,32766} ° ).

> So you are actually matching e{0} before all!


And if the sentence begins with "e.."? :)
  • Comment on Re^4: Greedy modifier found to be working non-greedy in a named group

Replies are listed 'Best First'.
Re^5: Greedy modifier found to be working non-greedy in a named group
by LanX (Saint) on Nov 30, 2019 at 20:19 UTC
    Good catch!

    The order must be reversed to reflect the greed.

    DB<8> x 'eeeA1234eB' =~ /(e+|e{0})(.)/ 0 'eee' 1 'A' DB<9> x 'A1234eB' =~ /(e+|e{0})(.)/ 0 '' 1 'A' DB<10> x 'A1234eB' =~ /(e+)(.)/ 0 'e' 1 'B' DB<11>

    Thanks!

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

    Updates

    Improved demo code

Log In?
Username:
Password:

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

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

    No recent polls found