in reply to Seeking clarification on possible bug in regex using \G and /gc
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; { local $_ = 'foo'; say '1 Start' if /\G foo/gcx; say '1 Mid' if /\G .*/gcx; say '1 End' if /\G \z/gcx; } { local $_ = 'foo'; say '2 Start' if /\G foo/gcx; say '2 Mid' if /\G .+/gcx; say '2 End' if /\G \z/gcx; }
Output:
1 Start 1 Mid 2 Start 2 End
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Seeking clarification on possible bug in regex using \G and /gc
by davido (Cardinal) on Mar 15, 2018 at 01:45 UTC | |
|
Re^2: Seeking clarification on possible bug in regex using \G and /gc
by Rhandom (Curate) on Mar 14, 2018 at 23:24 UTC | |
by choroba (Cardinal) on Mar 14, 2018 at 23:52 UTC |