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.
我需要*在字符串中检测
*
我尝试x =~ /*/并x =~ "/*/"
x =~ /*/
x =~ "/*/"
两种变体都不正确
请给我建议
*是正则表达式中的量词。你需要逃避它。
s =~ /\*/