I use WebParser to get one data on internet. Example:
...
RegExp="(?siU)...(.*)..."
...
(.*) -> " #very much white spaces# Stairway to Heaven"
How to delete all white spaces before the value ?
Become :
(.*) -> "Stairway to Heaven".
It is currently April 26th, 2024, 8:46 am
How to delete all white spaces ?
-
- Posts: 23
- Joined: May 23rd, 2010, 3:48 pm
-
- Rainmeter Sage
- Posts: 642
- Joined: July 19th, 2009, 5:59 am
- Location: Montreal, QC, Canada
Re: How to delete all white spaces ?
Try using \s*(\S.*) instead of (.*). The "\s" is shorthand for any whitespace, whereas "\S" is shorthand for anything that's NOT whitespace. Basically, this says to go through whitespace characters, until it hits a non-whitespace character, at which point it saves the rest. If you had a file like this:
And then used this RegExp:
The result would be "SOME STUFF".
Code: Select all
<tag1> SOME STUFF</tag1>
Code: Select all
RegExp="(?siU)<tag1>\s*(\S.*)</tag1>"
-
- Posts: 23
- Joined: May 23rd, 2010, 3:48 pm
Re: How to delete all white spaces ?
Thanks you. More...
\s*(\S.*) Before String
(\S.*)\s* After String
\s*(\S.*)\s* Before & After String.
\s*(\S.*) Before String
(\S.*)\s* After String
\s*(\S.*)\s* Before & After String.