if you want to use re module, compile your pattern with re.M|re.DOTALL to match multiple lines. however, looking at your case, there is really no need to use regex.
one way
Code:
f=open("file")
for line in f:
if "ID" in line:
id=line.split()[-1].strip()
if "W:" in line:
for i in range(8): line=f.next()
print "Eighth line after W: is ",line.strip()
second way is to use indexing, if you file is not too big, get everything into memory
Code:
data=open("file").read().split("\n")
for n,line in enumerate(data):
if "ID" in line:
#get your id
if "W:" in line:
print data[n+8]