I've been searching around for some time for this, but have still not found an answer, maybe its got some thing to do with regular expressions, but i think there should be a simple answer that I am missing here. It seems very trivial to me ... here goes:
On the python interpreter I get:
"abc" in "abc123"
as True.
I want it a command that returns a False. I want the entire word to be matched.
Thanks!
in
isn't how it's done.
>>> re.search(r'\babc\b', 'abc123')
>>> re.search(r'\babc\b', 'abc 123')
<_sre.SRE_Match object at 0x1146780>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With