我对正则表达式领域很陌生。最近我搜索了一个 Powershell 的正则表达式,它允许我匹配一个 html 标签,我在这个站点中找到了以下内容。
$content -match '(?s)<table[^>]+width\s*=\s*"300px"\s*.*?>(.*?)</table>'
我一直在寻找所有关于 (?s) 含义的正则表达式引用资料和书籍(Perl 和 Powershell),但没有运气。它看起来像一个条件,但缺少 then 部分。
有人能指出我正确的方向吗?
谢谢
最佳答案
根据 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.)
关于regex - 正则表达式中 (?s) 的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10927930/