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

Re^2: Seeking clarification on possible bug in regex using \G and /gc

by Rhandom (Curate)
on Mar 14, 2018 at 23:22 UTC ( #1210923=note: print w/replies, xml ) Need Help??


in reply to Re: Seeking clarification on possible bug in regex using \G and /gc
in thread Seeking clarification on possible bug in regex using \G and /gc

The closest mention I could see to this problem and perhaps a clue is: The additional state of being matched with zero-length is associated with the matched string, and is reset by each assignment to "pos()". So perhaps the issue is that the previous match succeeded - but did not advance pos, so when the /\G \z/ hits, pos doesn't advance and for some reason perl doesn't treat it as a successful match. I'm still with davido. I think this is a bit of a bug - it introduces failure at a distance in custom parsing engines. Luckily for cases such as these pos == length happens to be true.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
  • Comment on Re^2: Seeking clarification on possible bug in regex using \G and /gc

Replies are listed 'Best First'.
Re^3: Seeking clarification on possible bug in regex using \G and /gc
by Anonymous Monk on Mar 15, 2018 at 18:54 UTC

    The opposite would be worse. If it didn't work like this, subtle differences would be introduced when you refactor some code, merging regexen or splitting them apart.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2020-09-21 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (126 votes). Check out past polls.

    Notices?