It is currently April 26th, 2024, 4:07 pm

how to carriage return in InlineSetting/Pattern

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

how to carriage return in InlineSetting/Pattern

Post by Mor3bane »

I am using

Code: Select all

[MeasureOS]
Measure=Plugin
Plugin=SysInfo
SysInfoType=OS_VERSION
I would like to create a carriage return after the "windows" xx identifier in the string meter using this Measure.

I tried

Code: Select all

InlineSetting=\r
InlinePattern=Windows (.*)
But it doesn't work like expected.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to carriage return in InlineSetting/Pattern

Post by balala »

Mor3bane wrote:I would like to create a carriage return after the "windows" xx identifier in the string meter using this Measure.

I tried

Code: Select all

InlineSetting=\r
InlinePattern=Windows (.*)
But it doesn't work like expected.
For a such task you have to use a properly created substitution. The InlineSetting doesn't modify the shown value (can't add a new line) and InlineSetting=\r isn't a valid setting, which could be used.
Add the following two options to the [MeasureOS] measure:

Code: Select all

[MeasureOS]
...
RegExpSubstitute=1
Substitute="^(?siU)(windows) (.*)$":"\1#CRLF#\2"
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: how to carriage return in InlineSetting/Pattern

Post by Mor3bane »

balala wrote:For a such task you have to use a properly created substitution. The InlineSetting doesn't modify the shown value (can't add a new line) and InlineSetting=\r isn't a valid setting, which could be used.
Add the following two options to the [MeasureOS] measure:

Code: Select all

[MeasureOS]
...
RegExpSubstitute=1
Substitute="^(?siU)(windows) (.*)$":"\1#CRLF#\2"
Thanks balala
I am learning and remembering more every time I ask for regex/substitute help here on the forums.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to carriage return in InlineSetting/Pattern

Post by balala »

I'm glad if I helped.