对我来说似乎可以工作。 symbol = { heart: /<3/gm, }; > Object "hi there <3".match(symbol.heart) > ["<3"] 也许你的问题出在其他地方?
<
。 - Michael Berkowski