import re
p = re.compile(r'([-+]?)(?:0?x)([0-9A-Fa-f]+)')
test_str = u"WA2ąą-02 -7+12,7. -0x1AEfPq PP-.5P 0x1AEf +0x1AEf x0.6 words"

for x in re.findall(p, test_str):
	tmp = x[0] + x[1]
	print(int(tmp, 16))