‎02-05-2026 06:36 AM - edited ‎02-05-2026 06:38 AM
Match regular expression:
Why do this work: "<y:NodeLabel.*?>(.*?)<" on this text "<y:NodeLabel fontStyle="bold">MyG#SubClass</y:NodeLabel>"
but this: "<y:AttributeLabel.*?>(.*?)<" doesn't work on this
"<y:AttributeLabel xml:space="preserve">- AttrQueueLock:QUEUE REFNUM
- Ref:U32
- Timeout:BOOL
</y:AttributeLabel>"
Have i found a bug of am i missing something about RegExps?
(I solved the 2nd with "<y:AttributeLabel.*?>([^<]*)<", but why can't i use the same logic?)
Solved! Go to Solution.
‎02-05-2026 06:58 AM
A "." doesn't match line breaks by default. You can add a dotall "(?s)" modifier to change this.
"(?s)<y:AttributeLabel.*?>(.*?)<"
Matches:
"<y:AttributeLabel xml:space="preserve">- AttrQueueLock:QUEUE REFNUM
- Ref:U32
- Timeout:BOOL
<"
‎02-05-2026 07:01 AM
‎02-05-2026 07:21 AM
I recommend https://regex101.com to test regex. I would recommend AI to explain this kind of regex questions, but I hate AI (and use it anyway, but wash my mouth afterwards)
‎02-05-2026 07:29 AM
Thanks! I thought '.' matched _all_ characters. 🙂