I have follow Regex:
(.*?)( EUR)\1*
and on String 2 mm; EUR
it matches 2mm;
and EUR
but the String 2 mm;
matches nothing!?
But why ? I thought the *
meant zero or more times?
Can you help me?
Thank you!
I have follow Regex:
(.*?)( EUR)\1*
and on String 2 mm; EUR
it matches 2mm;
and EUR
but the String 2 mm;
matches nothing!?
But why ? I thought the *
meant zero or more times?
Can you help me?
Thank you!
It would have been a better approach to tell what result you want.
If you want a Regex to match "2 mm; EUR" or "2 mm;", it implies that you want to match a string starting with some kind of number (might be a millimiter length? something like that), ending with a ";" and eventually followed by the string " EUR".
If it is what you want, your regex should have a ";" inside and mark EUR with a "?" (0 or 1)
([
]+ .*?);( EUR)?