(?s)在正则表达式中的含义 [英] Meaning of (?s) in regex
问题描述
$ content -match'(?s)< table [^>] + width\s * = \s *300px\s *。*?>(。*?)< / table> '
我一直在寻找所有正则表达式的引用和书籍(Perl和Powershell),意思是(?s)没有运气。它看起来像一个条件,但缺少当时的部分。
有人可以指出我的正确方向吗?
谢谢
根据正则表达式参考站点。
打开点匹配换行符常规
表达式的剩余部分。 (旧的正则表达式可能会为整个正则表达式打开它。)
I am very new to the regular expression arena. Recently I searched for a regular expression for Powershell that allows me to match a html tag and I found the following in this site.
$content -match '(?s)<table[^>]+width\s*=\s*"300px"\s*.*?>(.*?)</table>'
I have been looking for all regular expressions references and books (Perl and Powershell) for the meaning of (?s) with no luck. It looks like a condition but missing the then part.
Can someone point me to the right direction for the meaning of this?
Thanks
According to Regular Expressions reference site.
Turn on "dot matches newline" for the remainder of the regular expression. (Older regex flavors may turn it on for the entire regex.)
这篇关于(?s)在正则表达式中的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!