Replace text and regular expressions
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(.*)hiie want it to match the "g" - Replacement text:
wx$1yzie want it to put the matched string between wx and yz
- Original text:
- 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)