I'm trying to produce the following "Query ID: XYZABC"
My code is as follows from a .txt file that has one instance of the following "Query= xyxysdfl;jas"
#!/usr/bin/env python3
import re
for line in open("/home/example.txt"):
query_id = re.search(r"Query=(.*$)", line)
if query_id != None:
print("Query ID: " + query_id.group())
This produces the following:
Query ID: Query= xyslkjjdf
How can I eliminate the "Query="? I thought I was doing that by including the (.*$)?