Reputation: 575
I have this pattern: "(\?(.+?))\b"
.
In python, what should happen, is findall
should return ("?var", "var")
if i run it on the string: "some text ?var etc"
.
It works normally elsewhere, here's a regexr for proof.
In python, re's findall
returns an empty list. Why is that?
Upvotes: 1
Views: 896
Reputation: 70750
You're not using raw string notation:
>>> import re
>>> re.findall(r'(\?(.+?))\b', 'some text ?var etc')
[('?var', 'var')]
Upvotes: 2