It is currently March 28th, 2024, 11:31 am

Filter out specific characters in regular expressions.

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Filter out specific characters in regular expressions.

Post by kyriakos876 »

Hello, I'm trying to filter out the spaces from the outcome of my RegExp but I don't quite get the syntax.
At the moment I have this:

(?siU)<em>(.*)</em>

And the result, when parsed, is like
text1 text2 text3 text4

and I would like to just have it return

"text1text2text3text4"

Could somebody help me?

-Thanks.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Filter out specific characters in regular expressions.

Post by balala »

kyriakos876 wrote:And the result, when parsed, is like
text1 text2 text3 text4

and I would like to just have it return

"text1text2text3text4"
Just add the following two options to the measure which returns the text1 text2 text3 text4 string:

Code: Select all

RegExpSubstitute=1
Substitute="\s+":""
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Filter out specific characters in regular expressions.

Post by kyriakos876 »

balala wrote:Just add the following two options to the measure which returns the text1 text2 text3 text4 string:

Code: Select all

RegExpSubstitute=1
Substitute="\s+":""
Thanks, that's what I needed.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Filter out specific characters in regular expressions.

Post by balala »

Glad to help.
Post Reply