Replace text and regular expressions

Revision as of 19:28, 27 June 2018 by Ttenbergen (talk | contribs)

Confuses me every time, so hoping to leave example this time.

Special:ReplaceText allows use of regular expressions, see their documentation.

Simple Example

  • Page has abcdefghi
    • Original text: abcdef(.*)hi ie want it to match the "g"
    • Replacement text: wx$1yz ie want it to put the matched string between wx and yz
  • results in wxgyz

Example with line end anchor

Not sure why it had to be used, but without it the rest of the words didn't get matched.

  • Before text (title): (T) Wrist Joint
  • O: \(T\) (.*)$ the $ shows end of line
  • R: $1 (T)
  • After text: Wrist Joint (T)