![]() |
1
4
在两者
结果:
|
![]() |
2
6
$ perl5.8 -e '{$s="else if (asdf \!= 1)"; if ($s =~ /^\s*if\s*\((\S+)\s*\!/) { print "|$1|\n";} else { print "NO MATCH\n";}}' NO MATCH $ perl5.8 -e '{$s="// if (asdf \!= 0)"; if ($s =~ /^\s*if\s*\((\S+)\s*\!/) { print "|$1|\n";} else { print "NO MATCH\n";}}' NO MATCH $ perl5.8 -e '{$s=" if (asdf \!= 0)"; if ($s =~ /^\s*if\s*\((\S+)\s*\!/) { print "|$1|\n";} else { print "NO MATCH\n";}}' |asdf| $ perl5.8 -e '{$s="if (asdf \!= 0)"; if ($s =~ /^\s*if\s*\((\S+)\s*\!/) { print "|$1|\n";} else { print "NO MATCH\n";}}' |asdf| $ perl5.8 -e '{$s="if (\$asdf \!= 0)"; if ($s =~ /^\s*if\s*\((\S+)\s*\!/) { print "|$1|\n";} else { print "NO MATCH\n";}}' |$asdf| |
![]() |
3
1
你可以试试:
.
将是零个或多个制表符或零个或多个空格,而不是空格和制表符的混合。 |
![]() |
lonix · 使用sed从JSON中提取非贪婪正则表达式 1 年前 |
![]() |
Dima Malko · 如何在指定符号前添加符号? 2 年前 |
![]() |
shekharsabale · 从列表元素捕获子字符串 2 年前 |
![]() |
Katia · 根据特定规则进行多行匹配 2 年前 |
![]() |
MHA · Pandas str.extract()以字母结尾的数字 2 年前 |
![]() |
Slava Vir · 如何查找后面“/”之间的最后一组 2 年前 |