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.
I don't have the source for the java application I am using. This is an app for which I can create a config file in which I specify a pattern and two groups and app picks them
pattern: (?m)^(?!#)\\s*([^.=\\s]*)\\.(?:[^.=\\s]*\\.)?([^.=\\s]*)\\s*=\\s*(.*?)\\s*$ key_group: 1 value_group: 2
I can only specify one group per key and one per value. According to this pattern app picks the key_group to be the key and value_group to be the value for it.
I don't want the garbage in the middle as it is random this changes the key every time.
Thanks