I have regular expression:
(?<message>.*)[\.](?:[\s]id:(?<id>.*)[\.])? code:(?<code>.*)[\.]
I have 2 cases for input text:
1. Failed to send sms. code:5063.
2. Failed to send sms. id:23. code:5063.
For the 1st case I want to have output like this:
1. Group message: Failed to send sms
2. Group code: 5063
For the 2nd case I want to have output like this:
1. Group message: Failed to send sms
2. Group id: 23
3. Group code: 5063
For the 1st case it's ok, but for the 2nd case I have:
1. Group Message: Failed to send sms. id:23
2. Group Code: 5063
It concatenates message and id. I can't understand why this is happening.
You can check it in the online editor here: https://regex101.com/r/bOWjKY/1/
Thank you in advance!