First of all, you should either escape the backslash or use raw strings:
'(<=\\$)\\d+$'
or
r'(<=\$)\d+$'
Then why use lookbehind or passive group? You want to grab the number, right? What about:
m = re.search('\\$(\\d+)',thestring)
Then retrieve your number using m.group(1)
.
source
to share