ANN: LogiPat -- Boolean logic pattern -> regular expression (ever want to match NOT a pattern?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ANN: LogiPat -- Boolean logic pattern -> regular expression (ever want to match NOT a pattern?)

Charles E Campbell Jr
Hello!

LogiPat takes Boolean logic arguments and produces a regular expression
which implements the choices.

Ever want to find every line that *doesn't* match some pattern?
How about every line that contains two strings, no matter the order?

LogiPat handles these problems easily.

A series of examples follows:

:LogiPat "abc"
        will search for lines containing the string "abc"

:LogiPat !"abc"
        will search for lines which don't contain the string "abc"

:LogiPat "abc"|"def"
        will search for lines which contain either the string "abc" or
the string "def"

:LogiPat !("abc"|"def")
        will search for lines which don't contain either of the strings
"abc" or "def"

:LogiPat "abc"&"def"
        will search for lines which contain both of the strings "abc"
and "def"

:let pat= LogiPat('!"abc"')
        will return the regular expression which will match all lines
not containing "abc".  The double quotes are needed to pass normal
patterns to LogiPat, and differentiate such patterns from boolean logic
operators.

Regards,
Chip Campbell