如何从字符串$abc
"this is $$abc abc$abc $abc abc_$abc_ing";
之类的字词
答案 0 :(得分:6)
您可以使用正则表达式:
(\$[a-z]+)
说明:
( : Start of group
\$ : A literal $. Since $ is a metacharacter we escape it.
[a-z]+ : one or more letters that is a word. You can use the modifier i
to match uppercase letters aswell.
) : End of grouping