1 Nov 2004 03:29
eric: do regular expressions work?
Parzival Herzog <parzp <at> shaw.ca>
2004-11-01 02:29:35 GMT
2004-11-01 02:29:35 GMT
I have wrestled a lot with the eric3 search & replace regexps. Today
I was completely stumped by what seems to me to be a very simple task:
to find the text "time" or "localtime".
With the text:
--------------
def today(time=localtime):
''' datetime for midnight, today '''
tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday,
tm_isdst = time()
return date(tm_year, tm_mon, tm_mday)
--------------
Searching for "time", and "localtime", (separately, and not a regular
expression) finds these.
Searching for "time|localtime" (regular expression) finds nothing.
The eric regular expression syntax is not documented, so I
tried:
"(time)|(localtime)" (maybe alternation has higher precedence than
concatenation)
"\(time\)|\(localtime\)" (maybe meta-parentheses need to be escaped)
"time)\|localtime" (maybe alternation needs to be escaped)
They all failed to find "time" or "localtime" in the above text.
Is the regexp search broken, or is the syntax even weirder than what I tried?
(Continue reading)
RSS Feed