Advanced Search - White Space handling

The character set white includes more than the simple set >'\t\x0A '. It includes all characters that are used for NewLine - and several others. This may not be what you want so there are some other possibilities.

To replace all single whitespace characters at the start of all lines:

Search < white
Replace

To replace multiple whitespace characters at the start of all lines:

Search <{white}+
Replace

To replace whitespace at the end of all lines:

Search white >
Replace

To collapse all multiple spaces to a single space:

Search {" "}+
Replace" "
This uses braces enclosing a single space with + to replace all occurrences of one or more spaces with a single space. However it is inefficient - it causes a lot of undo data. A more efficient method is
Search " " {" "}+
Replace" "
This does not find single spaces so only a single space followed by one or more spaces.

Include TABs

If you wish to replace TABs as well as spaces use { \t}+ (that is a space before the \t) in place of white and in the third example.

The White character set

StrongED's white character set is actually determined by the RISC OS Territory manager. But for UK [Icon -> Configure -> Keyboard -> UK (Default)] the characters that are considered as white, so are included in the set, are:

\x09tab
\x0aline feed
\x0bvertical tab
\x0cform feed
\x0dcarriage return
\x20space
\xa0hard space
The equivalent set is {'\x09-\x0d\xa0\x20'}+

Other relevant pages

Top of page


Page Information

http://css.torrens.org/valid-html401-bluehttp://css.torrens.org/valid-css Document URI: http://stronged.torrens.org/man/search/white.html
Page first published Saturday the 13th of January, 2018
Last modified:Wed, 30 May 2018 09:33:45 BST
© 2017 - 2018 Richard Torrens.