Hi all
I need some help in
java regex. I have a problem in capturing the last group which is optional. I have 3 strings I want to capture and 3rd on is optional.
Different input strings and input format is:
TS:This is system code[SYSCODE-123]
TS: This is system code[SYSTEM-123]
TS:This is system code.
TS12: This is system code
I need to extract three different
string where 3rd group in input string is optional and I want tmy group to be returned 'null' in that case if possible.
three components :
TS
This is system code
SYSCODE (optional , I want to extract contents inside square brackets if present).
I am reformatting these strings in my UI and need to know if 3rd group is present or not.Somehow I am not able to make it work.
This is regex i am trying to modify to make it work.
Regex: (TS-.+):(.*)(\\[(.+)\\]);
Thnks.