qr operation in perl 5.16

☆樱花仙子☆ 提交于 2019-12-02 10:46:44

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

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!