什么是regex;(?:^(?:not)$)”等;意思是

什么是regex;(?:^(?:not)$)”等;意思是,regex,regex-negation,Regex,Regex Negation,我有一个正则表达式 "(?:^(?:dont)$)" 这意味着什么?它可以用什么样的文本模式观看?与往常一样,您可以参考类似的正则表达式可视化工具 /"(?:^(?:dont)$)"/ " matches the characters " literally (?:^(?:dont)$) Non-capturing group ^ assert position at start of the string (?:dont) Non-capturing group dont matches t

我有一个正则表达式

"(?:^(?:dont)$)"

这意味着什么?它可以用什么样的文本模式观看?

与往常一样,您可以参考类似的正则表达式可视化工具

/"(?:^(?:dont)$)"/
" matches the characters " literally
(?:^(?:dont)$) Non-capturing group
^ assert position at start of the string
(?:dont) Non-capturing group
dont matches the characters dont literally (case sensitive)
$ assert position at end of the string
" matches the characters " literally

@digizimo谢谢!很高兴认识regx101。它有助于学习和使用正则表达式大大@Digiizmo阅读regex本身真的很痛苦。顺便说一句,对于regex101,它不支持java,而是支持python。java和python的正则表达式是否遵循相同的规则和模式?这取决于您使用的软件包/引擎,但大多数语言都会实现“类似perl的”功能,即正则表达式-101上的PCRE选项将涵盖学习过程中的大多数一般情况。提供了更多细节——这是一篇老文章,我并不完全精通不同语言之间的细微差别,但我认为它仍然是相关的。@Digizimo只是用它测试了几个案例。这两种环境中的情况确实非常相似。非常感谢。我真的想投你的意见作为答案!