Hi,
For other languages (except English) the text for detailed alerts looks like this:
Avis pour petites embarcations jusqu'à MER. 20:00 -04:00
OR
Perturbations possibles dues aux orages de JEU. 09:00 +03:00 à SAM. 09:00 +03:00
How to use RegExpSubstitute to stop displaying -04:00 or +03:00 ?
Thank You
It is currently March 29th, 2024, 1:26 am
RegExpSubstitute Help
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RegExpSubstitute Help
Try to add to the appropriate measure the following two options:
Code: Select all
RegExpSubstitute=1
Substitute="(\+|-)(\d{2}:\d{2})":""
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExpSubstitute Help
Code: Select all
[MeasureString]
Measure=String
String=Perturbations possibles dues aux orages de JEU. 09:00 +03:00 à SAM. 09:00 +03:00
RegExpSubstitute=1
Substitute="(?siU)[\+|\-]\d\d:\d\d":""
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RegExpSubstitute Help
Do you have to escape the - character as well? Because as far as I can tell, it is not a reserved character, so the backslash is not needed.jsmorley wrote: ↑June 17th, 2020, 6:15 pmCode: Select all
[MeasureString] Measure=String String=Perturbations possibles dues aux orages de JEU. 09:00 +03:00 à SAM. 09:00 +03:00 RegExpSubstitute=1 Substitute="(?siU)[\+|\-]\d\d:\d\d":""
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExpSubstitute Help
Probably not, I just didn't feel like double checking that, and it does no harm. In Lua "pattern matching" the - is in fact reserved. So better safe than sorry.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RegExpSubstitute Help
Alright, understand.
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: RegExpSubstitute Help
balala wrote: ↑June 17th, 2020, 6:14 pmCode: Select all
RegExpSubstitute=1 Substitute="(\+|-)(\d{2}:\d{2})":""
Both solutions work.jsmorley wrote: ↑June 17th, 2020, 6:15 pmCode: Select all
RegExpSubstitute=1 Substitute="(?siU)[\+|\-]\d\d:\d\d":""
Thank you very very much
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RegExpSubstitute Help
You are welcome...
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania