gpt4 book ai didi

Reference - What does this regex mean?(Reference--这个正则表达式是什么意思?)

转载 作者:bug小助手 更新时间:2023-10-28 11:04:06 28 4
gpt4 key购买 nike




What is this?


This is a collection of common Q&A. This is also a Community Wiki, so everyone is invited to participate in maintaining it.

这是一个常见问答的集合,这也是一个社区维基,所以每个人都被邀请参与维护它。


Why is this?


is suffering from give me ze code type of questions and poor answers with no explanation. This reference is meant to provide links to quality Q&A.

正则表达式正在遭受给我ZE代码类型的问题和没有解释的糟糕答案。此参考旨在提供指向质量问答的链接。


What's the scope?


This reference is meant for the following languages: , , , , , , .

此参考适用于以下语言:PHP、Perl、javascrip、python、ruby、Java、.Net。


This might be too broad, but these languages share the same syntax. For specific features there's the tag of the language behind it, example:

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



  • What are regular expression Balancing Groups?


更多回答

I created a meta discussion, everyone is invited >>>

我创建了一个Meta讨论,每个人都被邀请>>

优秀答案推荐

The Stack Overflow Regular Expressions FAQ


See also a lot of general hints and useful links at the tag details page.

另请参见regex标记详细信息页面上的许多常规提示和有用的链接。




Online tutorials

在线教程



Quantifiers

量词



Character Classes

字符类别



Escape Sequences

转义序列



Anchors









































































anchor matches flavors
^ Start of string Common*
^ Start of line Commonm
$ End of line Commonm
$ End of text Common* except
$ Very end of string *, D
\A Start of string Common except
\Z End of text Common except
\Z Very end of string
\z Very end of string Common except
\b Word boundary Common
\B Not a word boundary Common
\G End of previous match Common except ,







































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.
Very 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.


"Common" refers to the following:

“通用”指的是以下内容:icu Java javascrip.net Objective-c pcre Perl php python快速红宝石


* Default |
m Multi-line mode. |
D Dollar end only mode.

* 默认|m多线模式。| D Dollar end only mode.


Groups

群组



Lookarounds

环顾四周



Modifiers

修饰词




Other:

其他:



Common Tasks

常见任务



Advanced Regex-Fu

高级Regex-FU



Flavor-Specific Information

特定口味的信息


(Except for those marked with *, this section contains non-Stack Overflow links.)

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



General information

一般信息


(Links marked with * are non-Stack Overflow links.)

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



Examples of regex that can cause regex engine to fail

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



Tools: Testers and Explainers

工具:测试员和讲解员


(This section contains non-Stack Overflow links.)

(此部分包含非堆栈溢出链接。)




更多回答

Related: the question for which an answer starts with "You can't parse [X]HTML with regex.".

Related:答案以“您不能用正则表达式解析[X]HTML.”开头的问题。

Perl has more ((?( for conditional, for example) but you can read the perl official documentation instead.

Perl有更多的((?(例如,对于条件),但你可以阅读Perl官方文档。

Looks like Refiddle under the Tools section now points to some online casino site. Probably should be removed.

看起来,工具部分下的Refiddle现在指向了一些在线赌场网站。可能应该把它取下来。

I think the anchors section is incorrect for ruby, as per this

我认为Ruby的锚部分是不正确的,就像这样

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com