I'm using the Java matcher to try and match the following:
@tag TYPE_WITH_POSSIBLE_SUBTYPE -PARNAME1=PARVALUE1 -PARNAME2=PARVALUE2: MESSAGE
The TYPE_WITH_POSSIBLE_SUBTYPE consists of letters with periods.
Every parameter has to consist of letters, and every value has to consist of numerics/letters. There can be 0 or more parameters. Immediately after the last parameter value comes the semicolon, a space, and the remainder is considered message.
Everything needs to be grouped.
My current regexp (as a Java literal) is:
(@tag)[\\s]+?([\\w\\.]*?)[\\s]*?(-.*=.*)*?[\\s]*?[:](.*)
However, I keep getting all the parameters as one group. How do I get each as a separate group, if it is even possible?
I don't work that much with regexps, so I always mess something up.