I have the following piece of code:
s="sometext AB89NS0137JY more text AB1234"
pattern='AB[0-9A-Z].+'
print(re.findall(pattern,s))
which yields
['AB89NS0137JY more text AB1234']
I assumed this should return ['AB89NS0137JY','AB1234']
. I am probably missing something really elementary here, but I've been breaking my head over this. Could somebody explain how that piece of code should be changed to return ['AB89NS0137JY','AB1234']
?