%META:TOPICINFO{author="TWikiContributor" date="1687836840" format="1.1" version="$Rev$"}%
%META:TOPICPARENT{name="TWikiVariables"}%
#VarREPLACETEXT
---+++ REPLACETEXT -- search and replace text in a web
   * The =%<nop>REPLACETEXT{}%= variable is handled by the ReplaceTextPlugin; this variable is typically used in conjunction with a web form
   * Syntax: =%<nop>REPLACETEXT{ action="..." web="..." from="..." to="..." }%=
   * Parameters:%STARTSECTION{parameters}%
     | *Parameter* | *Description* | *Default* |
     | =action="..."= | Replace action: %BB% =""= - no action %BB% ="replace"= - do replace action based on below parameters, return result message, such as: %BR% %GRAY% &nbsp; Replaced FOO with BAR in 2 topics in Sandbox web %ENDCOLOR% | =""= |
     | =web="..."= | Name of web to search and replace text | (current web) |
     | =topic="..."= | Expert mode: Limit topics by name: A topic with asterisk wildcards, such as *Bug-**, or a list of topics separated by comma | (all topics) |
     | =filter="..."= | Expert mode: Limit topics by filtering topic text with a regex filter, optional | (no filter) |
     | =from="..."= | Text to search | (none, required) |
     | =to="..."= | Replacement text | (none, required) |
     | =search="..."= | Expert mode: Use this for more complex replace using regular expression grouping etc; typically supplied via a hidden input field. Use =$from= to specify the search text entered by the user | ="\b$from\b"= |
     | =replace="..."= | Expert mode: Use this for more complex replace using regular expression grouping etc; typically supplied via a hidden input field. Use =$to= to specify the replacement text entered by the user, use =$1=, =$2=, etc to reference captured groups | ="$to"= |
     | =dryrun="1"= | Do a dry run, e.g. a search only to simulate the replace action | ="0"= |
     | =showlist="1"= | Show the list of topics replaced | ="0"= |%ENDSECTION{parameters}%
   * Example usage: See raw text of ReplaceTextPlugin
   * Category: AdministrationVariables, ApplicationsAndComponentsVariables, DevelopmentVariables
   * Related: ReplaceTextPlugin
