jsmorley wrote: ↑October 26th, 2019, 1:46 pm
You just need to \escape the | pipe character(s) as that character is reserved in regular expression and means "OR".
While it won't hurt, the trailing $ is really not needed, as it will stop capturing when it hits #deg#. To be honest, the leading ^ is also not really needed, as it will always start at the beginning of the string. It both cases though, it does no harm, and may make it a bit clearer as to the intent.
The difference between * (zero or more) and + (one or more) is not really important in this case, although I tend to use + when (capturing) in InlinePattern, as the logic of "color this red if there are none of them" offends me at some level...
Ok, thx a lot for the help. At the end, it turned out as an easy issue, though it looked kind of serious in the beginning, even as a bug, at elast for me.
what would be a simpler solution for this occurrence, when there is no any (visible) sign between the two values, %1 and %2 and what if there is not the space at all? The values can be negative as well. Tightly related with the previous posts.
Pul53dr1v3r wrote: ↑January 19th, 2020, 8:31 pm
what would be a simpler solution for this occurrence, when there is no any (visible) sign between the two values, %1 and %2 and what if there is not the space at all? The values can be negative as well. Tightly related with the previous posts.
What would you want? I didn't understand, but supposing you'd like to color the second numeric value, try this: InlinePattern=^-?[\d]+\s*(-?[\d]+)#deg#$.
Sorry if I misunderstood you.
balala wrote: ↑January 19th, 2020, 9:36 pm
What would you want? I didn't understand, but supposing you'd like to color the second numeric value, try this: InlinePattern=^-?[\d]+\s*(-?[\d]+)#deg#$.
Sorry if I misunderstood you.
no, it's my mistake. i didn't explain well what i want. So, the i'd like to maintain the same colors using a simple way like Morle's provided for the previous case,
Pul53dr1v3r wrote: ↑January 19th, 2020, 11:27 pm
To be honest, i don't know how to determine the end of the 1st InlinePattern and the begining of the second... It must be very easy.
Post please the code of the measure which has the posted InlineSetting / InliniPattern options set on.
here is the whole test code. so the first character must have color1, the second color2 and the "°" is untouched.
This mr. Morley's advice might be helpful not to make a complicated formula: link
Pul53dr1v3r wrote: ↑January 20th, 2020, 3:35 pm
here is the whole test code. so the first character must have color1, the second color2 and the "°" is untouched.
ok, not the simplest but thx anyway.
i found that this one gives the same result, but not quite sure the result will be the same in all the possible cases:
pul53dr1v3r wrote: ↑January 21st, 2020, 9:13 pm
i found that this one gives the same result, but not quite sure the result will be the same in all the possible cases:
Probably good, as well. The InlineSetting colors with #color1# everything from the beginning to the first space (defined by the \s symbol). InlineSetting2 colors with #color2# the string placed between the first space (\s) and the degree character ([\x00B0]).
What is different is that if there are no numbers but strings (replacing for instance the Calc measure with String ones), your solution works as well, while mine works only for numbers.
pul53dr1v3r wrote: ↑January 21st, 2020, 9:13 pm
And what in case where any of the values can be either positive or negative, numeric and non-numeric but without the whitespace (\s).
If there is no space, what do you use between the two temperature values? I'm not sure I follow.