I want my string only have ([email protected]_) but when using this code:
import re
e='p12/[email protected]'
p=re.compile(r'[[email protected]_]')
for ele in e:
if bool(p.search(ele)):
print('okay')
else:
print('n')
it prints 'okay' but I expect to print 'n' because my string(e) contains '/' and I didn't declare it on my regex.
what should I do?
I also used re.match
and didn't help me either.