I'm trying to find a regex that will be capable of adding a trailing space at the end of every segment in a file in Studio. Does anyone know of a regular expression that would do the trick? Thanks!
I'm trying to find a regex that will be capable of adding a trailing space at the end of every segment in a file in Studio. Does anyone know of a regular expression that would do the trick? Thanks!
Find what: ^(.*)$
Replace with: $1#
where # should be replaced with a space (blank)
should work.
Caveat: For some reason, Studio 2019 Find/Replace handles the first segment incorrectly and so must be corrected manually.
Find what: ^(.*)$
Replace with: $1#
where # should be replaced with a space (blank)
should work.
Caveat: For some reason, Studio 2019 Find/Replace handles the first segment incorrectly and so must be corrected manually.
Yes, this does work, thank you very much Anthony!
The variant to skip any multiple spaces at the end of the string
^(.*?)\s*$
A more efficient and simpler solution:
(\S)$
with the above Replace string
This adds a space to be last character of the segment, unless it is already a whitespace
The reverse situation, namely to remove all trailing spaces, can be matched with the regex
(\s*)$
with a null (empty) Replace string