[Zope-Checkins] CVS: Zope2 - UnTextIndex.py:1.46.8.1
Andreas Jung
andreas@dhcp165.digicool.com
Wed, 18 Apr 2001 10:30:47 -0400
Update of /cvs-repository/Zope2/lib/python/SearchIndex
In directory yetix:/work/sandboxes/ajung-2_4-ts_regex-exterminiation-branch/lib/python/SearchIndex
Modified Files:
Tag: ajung-2_4-ts_regex-exterminiation-branch
UnTextIndex.py
Log Message:
ts_regex/regex free zone *sigh*
--- Updated File UnTextIndex.py in package Zope2 --
--- UnTextIndex.py 2001/03/27 23:50:31 1.46
+++ UnTextIndex.py 2001/04/18 14:30:33 1.46.8.1
@@ -94,7 +94,7 @@
__version__ = '$Revision$'[11:-2]
-import string, regex, regsub, ts_regex
+import string, re
import operator
from Globals import Persistent
@@ -558,7 +558,7 @@
parsed again, then the whole thing is 'evaluated'. """
# First replace any occurences of " and not " with " andnot "
- s = ts_regex.gsub(
+ s = re.sub(
'[%s]+[aA][nN][dD][%s]*[nN][oO][tT][%s]+' % (ws * 3),
' andnot ', s)
@@ -700,13 +700,13 @@
return q
-def parens(s, parens_re=regex.compile('(\|)').search):
+def parens(s, parens_re=re.compile('(\|)').search):
index = open_index = paren_count = 0
while 1:
index = parens_re(s, index)
- if index < 0 : break
+ if index is None : break
if s[index] == '(':
paren_count = paren_count + 1
@@ -728,7 +728,7 @@
def quotes(s, ws=(string.whitespace,)):
# split up quoted regions
- splitted = ts_regex.split(s, '[%s]*\"[%s]*' % (ws * 2))
+ splitted = re.split( '[%s]*\"[%s]*' % (ws * 2),s)
split=string.split
if (len(splitted) > 1):
@@ -752,3 +752,4 @@
splitted = filter(None, split(s))
return splitted
+