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.
"R".match(%r[^R])找到匹配项。
"R".match(%r[^R])
我对正则表达式了解不多,但我认为^在[否定字符类之后,括号之间的字符。
^
[
我错过了什么?
在您的情况下,括号不是正则表达式的一部分,您的情况类似于%r|^R|or或在 您想要的之前和之后%r'^R'放置任何字符是or%R%r|[^R]|/[^R]/
%r|^R|
%r'^R'
%
R
%r|[^R]|
/[^R]/