Better regexp

This commit is contained in:
Marco Pesenti Gritti 2007-06-04 23:53:23 +02:00
parent a9600516fb
commit 39d1f7b581

View File

@ -25,7 +25,7 @@ def get_name_and_version():
config = f.read() config = f.read()
f.close() f.close()
exp = 'AC\_INIT\(\[\w+\]\,\[([0-9.]+)\]\,\[\w*\]\,\[(\w+)' exp = 'AC_INIT\(\[[^\]]+\],\[([^\]]+)\],\[\],\[([^\]]+)\]'
match = re.search(exp, config) match = re.search(exp, config)
if not match: if not match:
print 'Cannot find the package name and version.' print 'Cannot find the package name and version.'