qr operation in perl 5.16

前端 未结 2 1631
长情又很酷
长情又很酷 2021-01-28 20:39

I am trying to fix a very old script, which is trying to find a string FILE_DESC_LIMIT in a text file and change it to something else.

For this my current s

相关标签:
2条回答
  • 2021-01-28 21:12

    See Regular Expressions in Perl 5.14 Delta: the (?^ now signifies default modifiers. It's just a matter of how the compiled regular expressions are serialized, the more important is the difference between \b and ^ in your regular expressions.

    0 讨论(0)
  • 2021-01-28 21:16

    The documentation on Extended Patterns in perlre has this

    Starting in Perl 5.14, a "^" (caret or circumflex accent) immediately after the "?" is a shorthand equivalent to d-imnsx . Flags (except "d" ) may follow the caret to override it. But a minus sign is not legal with it.

    Of those modifiers, -imsx matches what you saw in v5.10, while -n enables the capturing behaviour of parentheses and d enables "default" character set behaviour. These last two are new modifiers

    None of those are any different from the values you show in v5.10, so you will have to show your data and exactly what you wrote to get a change in behaviour

    0 讨论(0)
提交回复
热议问题