Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下的正则表达式c if statement 是我正在尝试但不匹配的
c if statement
if ( $line !~ /^if \(.\) \{/) {
我希望它与if ( a ==b ) {
if ( a ==b ) {
尝试交换。对于 .* ,它将在 "()" 中接受超过 1 个字符
if ($line =~ /^if\s*\([^\)]+\)\s*\{/)