我需要在 $ 之后拉出这串字符
($Q1==1)and($Q4o=="55")and($Q1o1=="")
我$Q1
的意思$Q4o
是这些$Q1o1
据我了解,正则表达式应该从$
除A-Za-z0-9_
. 你能帮我写正则表达式吗?
This seems to work, at least in Ruby:
/\$\w*/
Be careful with the $, as $ is a reserved symbol in regular expressions that means "end of the string", so you need to escape it.
/\$([[:alnum:]]+)[[^:alnum:]]/
您需要提取第一个括号表达式。
编辑:我更喜欢另一个建议,使用 \w*