I have a string:
"{balba $aaa = $bbb.test == $ddd == $sdfsf.dfgdfg.dfg}"
I tried to create a regex that extract all vars without a dot.
Expected result is:
- $aaa
- $ddd
My regex is \$[a-zA-Z0-9_]*[^\.] but it does not work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You didn’t give the language, so here is a solution using a negative lookahead and a possessive quantifier (NOTE: not supported by some flavours).
See it here on Regexr
\w++Match at least one word character and do not backtrack.(?!\.)a negative lookahead that ensures that there is no.following