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
Should instead printperl -E 'local $_ = "foo"; say "Start" if /\G foo/gcx; say "Mid" if /\ +G .*/gcx; say "End" if /\G \z/gcx' Start Mid
Here is a more extended item looking at pos as well.Start Mid End
perl -E 'local $_ = "foo"; say "Start" if /\G foo/gcx; say pos; say "M +id" if /\G .*/gcx; say pos; say "End" if /\G \z/gcx; say "At End" if +pos == length' Start 3 Mid 3 At End
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Seeking clarification on possible bug in regex using \G and /gc
by choroba (Cardinal) on Mar 14, 2018 at 23:52 UTC |