?单独表示:选择匹配之前的内容.
在你的情况下,(?=是一个前瞻断言,意思是:如果只是匹配(括号中的内容),则跟随.
Reference
(?: … )
Non-capturing parentheses. Groups the included pattern,but
does not provide capturing of matching text. Somewhat more efficient
than capturing parentheses.
(?> … )
Atomic-match parentheses. First match of the parenthesized
subexpression is the only one tried; if it does not lead to an overall
pattern match,back up the search for a match to a position before the
“(?>”
(?# … )
Free-format comment (?# comment ).
(?= … )
Look-ahead assertion. True if the parenthesized pattern
matches at the current input position,but does not advance the input
position.
(?! … )
Negative look-ahead assertion. True if the parenthesized
pattern does not match at the current input position. Does not advance
the input position.
(?<= … )
Look-behind assertion. True if the parenthesized pattern
matches text preceding the current input position,with the last
character of the match being the input character just before the
current position. Does not alter the input position. The length of
possible strings matched by the look-behind pattern must not be
unbounded (no * or + operators.)
(?<! … )
Negative Look-behind assertion. True if the parenthesized pattern does not match text preceding the current input position,with the last character of the match being the input character just before the current position. Does not alter the input position. The length of possible strings matched by the look-behind pattern must not be unbounded (no * or + operators.)