[pmwiki-users] search and replace

Patrick R. Michaud pmichaud at pobox.com
Wed Sep 28 14:13:30 CDT 2005


On Wed, Sep 28, 2005 at 08:41:18PM +0200, Stephan Schildberg wrote:
> How can I aply "search-and-replace" to a string, which exists far too 
> often in one wiki of mine?
> Is it planned to establish a form to assist authors (which would be great)?
> I did not find a hint in the documentation , or it was just covered by 
> other distracting themes.

1.  You can create a markup rule for it:

    Markup('searchstring', 'begin',
      '/searchstring/', 
      'replacestring');

2.  You can create a replace-on-save pattern for it:

    $ROSPatterns['/searchstring/'] = 'replacestring';


#1 causes any instances of "searchstring" to be rendered as if
"replacestring" had been entered.  #2 causes any instances of
"searchstring" in a page's text to be replaced by "replacestring"
when the page is saved.

There's not yet a more general solution that I'm aware of, short
of manipulating the wiki.d/ files directly.

Pm




More information about the pmwiki-users mailing list