[pmwiki-users] Fox replace and variable in regular expression

Benjamin Grassineau benjamingrassineau at gmail.com
Fri Feb 19 09:26:23 CST 2016


Hello list !

I have a question for fox users !

Do you think it's possible to get the input of a form, and use it in a
regular expression in order to replace a content ?

Example :

I would like to replace a variable word by great in a page. So I create the
following form :

(:fox test:)
(:foxreplace target=Public.Test put=regex mark='/{$$word}/':)
(:foxtemplate "great":)
(:input text name='word':)
(:input submit post:)
(:foxend test:)

Of course, I could use the parameter put=string, but I need to include
"word" in a regular expression.

Unfortunately it doesn't work. And I didn't find the good syntax.

So my question is : is there a good syntax ? Or maybe it's simply
impossible to include a variable in the regular expression ?

Thanks. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20160219/2d29676b/attachment.html>


More information about the pmwiki-users mailing list