qr operation in perl 5.16

前端 未结 2 1705
长情又很酷
长情又很酷 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: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

提交回复
热议问题