Does the 'o' modifier for Perl regular expressions still provide any benefit?

后端 未结 6 1830
醉话见心
醉话见心 2020-11-29 07:48

It used to be considered beneficial to include the \'o\' modifier at the end of Perl regular expressions. The current Perl documentation does not even seem to list it, cert

6条回答
  •  暖寄归人
    2020-11-29 08:32

    One thing it, mystifyingly, does not do is, allow a ONCE block, at least at 5.8.8.

    perl -le 'for (1..3){ print; m/${\(print( "between 1 and 2 only"), 3)}/o and print "matched" }'

提交回复
热议问题