I want to match space chars or end of string in a text.
import re
uname='abc'
assert re.findall('@%s\s*$' % uname, '@'+uname)
assert re.findall('@%s\s*$' % uname, '@'+uname+' '+'aa')
assert not re.findall('@%s\s*$' % uname, '@'+uname+'aa')
The pattern is not right.
How to use python?