Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 这个正则表达式的含义_Regex - Fatal编程技术网

Regex 这个正则表达式的含义

Regex 这个正则表达式的含义,regex,Regex,谁能告诉我这个正则表达式标识了什么:(?![^&;]+;)(?!)(?![^&;]+;) 谢谢 第一个: " (?! # Assert that it is impossible to match the regex below starting at this position (negative lookahead) [^&;] # Match a single character NOT present in the list “&;”

谁能告诉我这个正则表达式标识了什么:
(?![^&;]+;)(?!)(?![^&;]+;)

谢谢

第一个:

"
(?!         # Assert that it is impossible to match the regex below starting at this position (negative lookahead)
   [^&;]       # Match a single character NOT present in the list “&;”
      +           # Between one and unlimited times, as many times as possible, giving back as needed (greedy)
   ;           # Match the character “;” literally
)
(?!         # Assert that it is impossible to match the regex below starting at this position (negative lookahead)
   <           # Match the character “<” literally
   [^<>]       # Match a single character NOT present in the list “<>”
      *           # Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
)
"
”
(?!#断言从这个位置开始不可能匹配下面的正则表达式(负前瞻)
[^&]#匹配列表中不存在的单个字符“&;”
+#在一次和无限次之间,尽可能多次,根据需要回馈(贪婪)
##按字面意思匹配字符“;”
)
(?!#断言从这个位置开始不可能匹配下面的正则表达式(负前瞻)
<#按字面意思匹配字符“#按字面意思匹配字符”>
)
(?!#断言从这个位置开始不可能匹配下面的正则表达式(负前瞻)
[^&]#匹配列表中不存在的单个字符“&;”
+#在一次和无限次之间,尽可能多次,根据需要回馈(贪婪)
##按字面意思匹配字符“;”
)
"

请注意,这两个表达式实际上并没有捕获任何内容,但它们可能用于精确定位字符串内部的位置。没有任何上下文,很难准确说出它们的使用位置。

非常感谢。这对我帮助很大!!@FailedDev先生,你是个天才。你有没有用来帮助解析它的应用程序,或者你只是一个regex大师吗?@Daryl不,我不是天才,是的,我有一个应用程序。Expresso/regexbuddy举几个例子。
"
(?!         # Assert that it is impossible to match the regex below starting at this position (negative lookahead)
   [^<>]       # Match a single character NOT present in the list “<>”
      *           # Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
   >           # Match the character “>” literally
)
(?!         # Assert that it is impossible to match the regex below starting at this position (negative lookahead)
   [^&;]       # Match a single character NOT present in the list “&;”
      +           # Between one and unlimited times, as many times as possible, giving back as needed (greedy)
   ;           # Match the character “;” literally
)
"