RegEx to match a pattern and exclude a part of the string
- by rojanu
Hi,
I have got some strings to be matched via RegEx. We have a java application which reads the regex from a config file and takes two groups of strings, number of which are specified in the same config.
E.g.
CustomAction.523274ca945f.dialogLabel=Executing Custom Code...
will be matched with
(?m)^(?!#)\s*(\S*)\s*=\s*(\S*.*)
What I need is to pick the first group "CustomAction.523274ca945f.dialogLabel" and exclude the random string in the middle so I end up with something like "CustomAction.dialogLabel" or "CustomAction..dialogLabel" well any other combination but the random string.
Thanks