Tags:
create new tag
view all tags

REPLACETEXT -- search and replace text in a web

  • The %REPLACETEXT{}% variable is handled by the ReplaceTextPlugin; this variable is typically used in conjunction with a web form
  • Syntax: %REPLACETEXT{ action="..." web="..." from="..." to="..." }%
  • Parameters:
    Parameter Description Default
    action="..." Replace action:
    "" - no action
    "replace" - do replace action based on below parameters, return result message, such as:
      Replaced FOO with BAR in 2 topics in Sandbox web
    ""
    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"
  • Example usage: See raw text of ReplaceTextPlugin
  • Category: AdministrationVariables, ApplicationsAndComponentsVariables, DevelopmentVariables
  • Related: ReplaceTextPlugin
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2023-06-30 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.