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 remove all single whitespace characters at the start of all lines:

Search < white

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

Search <{white}+

To remove whitespace at the end of all lines:

Search white >

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:

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

Was this page helpful? Please email me and/or rate this page:

If you want a reply make sure any email address will not get spam-binned!
Optional comment

Other relevant pages

Top of page

Page Information Document URI:
Page first published Saturday the 13th of January, 2018
Last modified:Tue, 24 Sep 2019 08:39:33 BST
© 2017 - 2024 Richard Torrens.