Skip to main content.
home | support | download

Back to List Archive

ReplaceRules regex

From: Aubrey Lee Hutchings <aubreyh(at)>
Date: Thu Feb 19 2004 - 00:57:34 GMT

I'm new to swish-e and debian and having a little bit of trouble
with some of the ReplaceRules in my config file. I've done some
searching though google and the documentation but I'm still stuck; any
help on this problem would be great.

I'm running swish-e 2.0 on debian stable.

I'm using a perl front end I found through that requires
the full path name be replaced with the URL of the website, for example:


must be replaced with

I chose to do this with ReplaceRules regex, but never got it to work

Here's my config file:

### start of config file ###

IndexDir /var/www/
IndexOnly .html 
IndexFile ./twilight-html.index

ReplaceRules regex !^/var/www/!!

### end of config file ###

When I build the index all seems well. However, when I try to search,
things come back very strange.

$ swish-e -f twilight-html.index -w james | grep -v '^#'
1000 &@&@ "twilight.html" 200
14 &@&@ "example-1.html" 6816
14 &@&@ "swish_search.html" 6581
11 &@&@ "example-2.html" 7564

(Note: The extra grep on the command cut out the garbled characters
in the command line search that hang my xterm.)

The file name is all garbled. I tested the regular expression, so I
don't think it is the problem. For now I commented out the regex and
added the following line to my config

ReplaceRules replace "/var/www/" ""

and things work great. However, as I customize swish-e further I would
like to be able to use regex. Does anyone have any ideas?


Aubrey Hutchings
ECEn Sysop
Received on Wed Feb 18 16:57:36 2004