[Tutor] Advanced String Search using operators AND, OR etc..

spir denis.spir at free.fr
Tue May 5 15:49:08 CEST 2009


Le Tue, 05 May 2009 22:11:22 +1000,
Lie Ryan <lie.1296 at gmail.com> s'exprima ainsi:

> Idea:
> Overrides the operator on Pattern class so we could write it like: 
> P("Hello") & P("World") instead of AND(P("Hello"), P("World"))

You could also override directly all python logical ops to allow direct expression of logical searches in python (~ like in pyparsing).
   (P("Hello") or P("Salut")) and (P("World") and not P("Universe"))
(Then rewriting from user expression may even be easier.)

;-)

Denis
------
la vita e estrany


More information about the Tutor mailing list