# Utility functions
# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.5 2000-11-30 04:19:30 troup Exp $
+# $Id: utils.py,v 1.6 2000-12-01 17:33:29 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
######################################################################################
+# Escape characters which have meaning to SQL's regex comparison operator ('~')
+# (woefully incomplete)
+
+def regex_safe (s):
+ s = string.replace(s, '+', '\\\\+');
+ return s
+
+######################################################################################
+