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.
我知道这些不会这样做,也知道为什么,但你如何匹配它?
/^/ /(^)/ /[^]/
用反斜杠转义它:
/\^/
这将使它被解释为文字^字符。
^
我认为这可行(我已经在java中测试过):
\\^
'\' 用作转义字符,因此您首先转义 '^',然后转义 '\' 本身
你可以在这里找到更多信息:http ://www.regular-expressions.info/characters.html