PHP 最近放弃 [[:POSIX:]] 正则表达式风格的要点

发布于 2024-09-14 16:57:54 字数 517 浏览 4 评论 0原文

在更高的 PHP 版本中删除 ereg 函数及其 POSIX 正则表达式风格?

阅读旧帖子“PHP ereg vs. preg”(2009 年 9 月) 对此感兴趣 - 并阅读官方 PHP 声明 我倾向于问这是关于什么的。随着 PHP 多年来的发展(并在 Perl 和 PHP 中进行了大量开发),我真的不确定这最终是否会是一个糟糕的漂移。

我假设 PHP 开发团队的一些成员在这里,因此他们能够帮助更深入地了解这一点。

是否有计划的增强功能(未来)来完成 [[:POSIX:]] 风格的 preg 函数?或者后者会永远消失吗?这两个决定背后的理由是什么?

Dropping of the ereg-functions and their POSIX-regular expression flavor in later PHP versions?

After reading the older posting "PHP ereg vs. preg" (Sep '09) concerned of this - and reading the official PHP statement I'm inclined to ask what this is about. Following the development of PHP over the years (and doing much development in Perl and PHP) I'm really unsure if this might be not a bad drift eventually.

I'd assume there would be some members of the PHP development team here on SO, therefore they'd able to help getting some more insight into this.

Are there planned enhancements (future) to complete the preg-functions with the [[:POSIX:]] style? Or will the latter be gone forever? What's the rationale behind either decision?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

榕城若虚 2024-09-21 16:57:54

You can check the last comment before the last here: http://bugs.php.net/49594

[2009-10-01 20:03 UTC] [email protected]
We did not write the regex
implementation. We rely on 3rd-party
libraries for everything in PHP. If a
POSIX-compatible library that supports
Unicode magically appears, we can
consider it, but as of right now that
does not exist and we are not going to
write one. I doubt any of the other
scripting languages are going to do
that either. Python and Ruby both
rely on PCRE as well, so we all
support the same type of regular
expressions.

The responsible thing for us to do,
given the state of regex libraries, is
to let users know that Unicode is the
future and their current POSIX regular
expressions is not going to work in
this Unicode world and they need to
plan for that.

I am sorry you do not agree with that,
but that is the state of things
currently.

Also other comments on the thread suggest that PCRE is faster, more consistent in syntax and is used in other languages such as Ruby or Python too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文