Testing Regular Expressions

You can test regular expressions with Alkaline in order to save time when building the appropriate word exclusion dictionaries or url exclusion lists. It also allows to test regexp replacements for options supporting it. The command line syntax is:
asearch [string] rxmatch [regexp]
asearch [string] rxrepl [source regexp] [target regexp]
For example:
$ ./asearch "http://server/whatever.cgi?name=value" rxmatch "(http://server/whatever\.cgi\?)(.*)(=value)"
[http://server/whatever.cgi?name=value] positively
 matches [(http://server/whatever\.cgi\?)(.*)(=value)]

$ ./asearch "http://server/whatever.cgi?name=value" rxmatch "(http://server/whatever\.cgi\?)(.*)(=other)"
[http://server/whatever.cgi?name=value] does not
 match [(http://server/whatever\.cgi\?)(.*)(=other)]

$ ./asearch http://www.vestris.com rxrepl "(.*)(www)(.*)" "\1ns\3"
      

The rxmatch feature was added 02-Jul-2000. The rxrepl feature was added 12-Jul-2000. For more information about the regular expressions features, please refer to the RegExp asearch.cnf directive reference.