I'm trying to extract the following substring from the string
-- CVS Header: $Source: /CVS/oracle11i/database/erp/apps/pkgspec/wwt_prime_pkg.p
ls,v $, $Revision: 1.14 $, $Author: $, $Date: 2014/09/23 21:41:15 $
String I want to extract: $Revision: 1.14 (or just 1.14)
My code is as follows:
from sys import *
from os.path import *
import re
script, filename = argv
print "Filename: %s\n" % filename
def check_string():
found = False
with open(filename) as f:
for line in f:
if re.search("(?<=\$Revision: ) 1.14", line):
print line
found = True
if not found:
print "No Header exists in %s" % filename
check_string()
This does not seem to be working.
Any suggestions?
Thanks!