import re
p = re.compile('^TestVar\s+(\d{8})\s+(\S+)')
m = p.match('TestVar 00000000  WWWWWW 222.222 222.222 222.222')
if m:
    print 'Match found: ', m.group(2) + '_' + m.group(1)
else:
    print 'No match'