avatar
P*i
1
【 以下文字转载自 Linux 讨论区 】
发信人: PaiMei (白眉), 信区: Linux
标 题: re一问
发信站: BBS 未名空间站 (Tue Nov 21 00:04:19 2006), 站内
如何把一个string的'(*)'都删掉,*是任意sub-string,但不含左右括号。
例子:
aaa(a123)b(cd)(123)edf
=>aaabedf
avatar
a*1
2
Well I am not a theoretical guy, the things I can tell you are:
(1) Both Perl and PHP are using NFA, check J. Friedl's book MRE.
(2) You might be right in theorem, while in the real life, different
regex flavors have embedded different functionalities into their
engines, no need to following the dogma in the book.
(3) Regex flavors like Perl and PHP support dynamic regrx constructs,
which makes them more powerful than many other languages in handling
texts.
Good luck.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。