如果我也瞭解你的需求,怎麼樣:
(\w+\(\w+\))| \([\w\s]+\)
說明:
The regular expression:
(?-imsx:(\w+\(\w+\))| \([\w\s]+\))
matches as follows:
NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with^and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
\w+ word characters (a-z, A-Z, 0-9, _) (1 or
more times (matching the most amount
possible))
----------------------------------------------------------------------
\( '('
----------------------------------------------------------------------
\w+ word characters (a-z, A-Z, 0-9, _) (1 or
more times (matching the most amount
possible))
----------------------------------------------------------------------
\) ')'
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
| OR
----------------------------------------------------------------------
' '
----------------------------------------------------------------------
\( '('
----------------------------------------------------------------------
[\w\s]+ any character of: word characters (a-z, A-
Z, 0-9, _), whitespace (\n, \r, \t, \f,
and " ") (1 or more times (matching the
most amount possible))
----------------------------------------------------------------------
\) ')'
----------------------------------------------------------------------
) end of grouping
這似乎沒有在Notepad ++中提供的示例文本上工作。我正在使用v5.9.2 – Kash
@Kash:你需要V6.0 + – Toto
這個解釋是從什麼地方自動生成的? – Retsam