xxxxxxxxxx
import re
q = "A32 and a little code A22"
re.findall("A\\w+"+'[0-9]', q) #all word starting with 'A' and numbers
output:
[A32, A22]
xxxxxxxxxx
import re
re.compile(r'[/d]+')
# /d refers to any digit
# use other regex patters for ore modifcations
# This can extract the numbers from the regex
xxxxxxxxxx
[0-9] is not always equivalent to \d. In python3, [0-9] matches only
0123456789 characters, while \d matches [0-9] and other digit characters,
for example Eastern Arabic numerals.