[Zope] help with regular expressionism

Peter Bengtsson mail@peterbe.com
Sun, 6 Jan 2002 15:11:18 +0100


When searching I would like to display the result where the searchterm is 
highlighted in someway. Like it is on google.com
When you search for say "peter" the word "Peter" is highlighted with 
"<b>Peter</b>". So is also "<b>pEtEr</b>"

Does anybody have a little script to do the following transformation??:

searchterm="Peter"

original_string ="PEters name is peter"

result_string:
>>> "<b>PEter</b>a name is <b>peter</b>"


Cheers, Peter