You are not logged in.
Pages: 1
How can I do a global match as outlined here?
For example (simple hypothetical) if I wanted to strip all white space from part of a string:
https://stackoverflow.com/questions/180 … hitespaces
Any help greatly appreciated.
Offline
FROM:
" tushar is a good boy "
TO:
"tushar is a good boy"
You can use the CleanUp Rule with "Fix spaces"
https://www.den4b.com/wiki/ReNamer:Rules:CleanUp
- - -
If you prefer RegEx:
FROM:
" tushar is a good boy "
TO:
" tushar is a good boy "
You can regex search for "\s\s+" and replace by one single space.
and to get
"tushar is a good boy"
To remove leading and trailing spaces also, additionally search for "^\s+|\s+$" and replace with nothing in an second RegEx rule.
https://www.den4b.com/wiki/ReNamer:Rules:RegEx
- - -
And now altogether with only one RegEx rule:
FROM:
" tushar is a good boy "
TO:
"tushar is a good boy"
Search for "^\s+|\s+$|(\s)\s+" and replace with "$1"
That is "^\s+ | \s+$ | (\s)\s+"
For more complex rules we would use PascalScript.
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Pages: 1