adding findRe, deprecating findRegexp

This commit is contained in:
Rolux 2008-05-07 09:26:55 +02:00
parent 6861269959
commit f4bb9d7fff

View file

@ -4,12 +4,15 @@
import re import re
def findRegexp(string, regexp): def findRe(string, regexp):
result = re.compile(regexp, re.DOTALL).findall(string) result = re.compile(regexp, re.DOTALL).findall(string)
if result: if result:
return result[0].strip() return result[0].strip()
return None return None
def findRegexp(string, regexp):
return findRe(string, regexp)
def findString(string, string0='', string1 = ''): def findString(string, string0='', string1 = ''):
"""Return the string between string0 and string1. """Return the string between string0 and string1.