From: W. Trevor King Date: Fri, 29 Aug 2008 08:39:58 +0000 (-0400) Subject: Added regexp matching for Location search X-Git-Tag: 0.3~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9d9fd727175e102a83aec4aaeb74fcd03b914179;p=chemdb.git Added regexp matching for Location search --- diff --git a/chem_web.py b/chem_web.py index c49ffc7..9dc68f0 100755 --- a/chem_web.py +++ b/chem_web.py @@ -189,8 +189,8 @@ class docs (object) : db._refresh() formdata = web.input() user_regexp = formdata['regexp'] - regexp = self.validate_string(user_regexp) - path = dgen.door_warning(lambda r: r['Location'] == regexp ) # no regexp matching yet, work in progress + regexp = re.compile(self.validate_string(user_regexp), 'I') # Case insensitive + path = dgen.door_warning(lambda r: regexp.match(r['Location'])) print file(path, 'rb').read() , def validate_string(self, string): # work in progress return string