in reply to Re: Regex: Embedded pattern-match modifiers: Empty (?) modifier
in thread Regex: Embedded pattern-match modifiers: Empty (?) modifier

My guess — and it’s no more than a guess — is that the documentation is wrong, and should read: Zero or more embedded pattern-match modifiers ...

Even if it is only a guess that the documentation is wrong: if it is underpinned by valid test cases, this warrants a bug report, so this can be evaluated and eventually be fixed.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re^2: Regex: Embedded pattern-match modifiers: Empty (?) modifier

Replies are listed 'Best First'.
Re^3: Regex: Embedded pattern-match modifiers: Empty (?) modifier
by choroba (Cardinal) on Feb 12, 2018 at 14:09 UTC
    Reported. Watch the thread for updates, currently it isn't clear whether the code will be fixed, or the docs.

    ($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,
      Perl 5.30 will change the documentation to Zero, and this will remain legal to accommodate machine generated code. A warning will be issued if the pattern is compiled within the scope of a "use re 'strict'" pragma. This will accommodate people who want to catch no-ops that are possibly typos.