【问题标题】:Reference - What does this regex mean?参考 - 这个正则表达式是什么意思?
【发布时间】:2021-05-20 00:34:24
【问题描述】:

这是什么?

这是常见问答集。这也是一个社区 Wiki,因此邀请所有人参与维护它。

这是为什么?

正在遭受 give me ze code 类型的问题和没有任何解释的糟糕答案。此参考旨在提供高质量问答的链接。

范围是多少?

此参考适用于以下语言:

这可能过于宽泛,但这些语言共享相同的语法。对于特定的功能,它背后有语言的标签,例如:

  • 什么是正则表达式平衡组?

【问题讨论】:

标签: regex php perl javascript python ruby java .net .net regex


【解决方案1】:

堆栈溢出正则表达式常见问题解答

tag details page 上还可以查看很多一般提示和有用的链接。


在线教程

量词

字符类

转义序列

锚点

anchor matches flavors
^ Start of string Common*
^ Start of line Commonm
$ End of line Commonm
$ End of text Common*
$ The very end of string D,
\A Start of string Common except
\Z End of text Common except
\Z The very end of string
\z The very end of string Common except
\b Word boundary Common
\B Not a word boundary Common
\G End of previous match Common except , re
Term Definition
Start of string At the very start of the string.
Start of line At the very start of the string, and
after a non-terminal line terminator.
End of string At the very end of the string.
End of text At the very end of the string, and
at a terminal line terminator.
End of line At the very end of the string, and
at a line terminator.
Word boundary At a word character not preceded by a word character, and
at a non-word character not preceded by a non-word character.
End of previous match At a previously set position, usually where a previous match ended.
At the very start of the string if no position was set.

“普通”指的是:p>

* 默认| m 多行模式。 | D 美元结束模式。

群组

环顾四周

修饰符

其他:

常见任务

高级正则表达式-Fu

风味特定信息

(标有* 的除外,此部分包含非堆栈溢出链接。)

一般信息

(标有* 的链接是非堆栈溢出链接。)

可能导致正则表达式引擎失败的正则表达式示例

工具:测试者和解释者

(此部分包含非 Stack Overflow 链接。)

【讨论】:

  • 相关:the question for which an answer“您无法使用正则表达式解析 [X]HTML。” 开头。
  • Perl 有更多(例如(?( 用于条件),但您可以阅读 perl 官方文档。
  • “工具”部分下的Refiddle 现在指向某个在线赌场网站。可能应该被删除。
猜你喜欢
相关资源
最近更新 更多