我不认为白鹭会成功。 你需要一个可以做lookaheadAssert的grep,原因如下: /^ s (.) (?:(?:\\.|(?!\1).)+\1){2} (?:\\.|(?!\1).)+ $/xs
/^ # Begin of string
s
(.) # capture first char after 's'
(?: # Begin Grp
(?: \\. # begin grp, escaped anything
| (?!\1). # OR, any char that is not (.)
)+ # end grp, do this more than once
\1 # Followed by (.)
){2} # End Grp, do this exactly twice
(?: \\. # begin grp, escaped anything
| (?!\1). # OR, anchar that is not (.)
)+ # end grp, do this more than once
$/xs # End of string, x and s modifiers
1条答案
按热度按时间yqhsw0fo1#
我不认为白鹭会成功。
你需要一个可以做lookaheadAssert的grep,原因如下:
/^ s (.) (?:(?:\\.|(?!\1).)+\1){2} (?:\\.|(?!\1).)+ $/xs