Goal:
Match the first word (named group <type>) after any number of white spaces then match the last occurence of space+colon+equal+space+opening square ie ( := [) and return the opening square along with all characters upto and including a last closing square + semi-colon + carriage return (named group <value>). The named group <type> must ignore all characters between after the first matched word and the start of named group <value>.
Problem:
The regular expression below matches if there are no characters are between <type> and <value> other than space+colon+equal+space ie ( := ), however if characters do exist then it does not match...ugh!
Current Match:
<type> : InputForceData
<value> : [0,2,0,6,1,0,0,0,3]
Desired Match:
<type> : InputData
<value> : [0,1,2,3,4]
<type> : InputForceData
<value> : [0,2,0,6,1,0,0,0,3]
Platform:
.Net (VS2008)
Regular Expression
\s*(?<type>\b\w+\b*?)\s:=\s(?<value>\[.*?);\r
Sample Text:
CONNECTION StandardInput (Rate := 10000,
EventID := 0)
InputData (COMMENT.DATA.0 := "P903_RUN_STAT",
COMMENT.DATA.1 := "P905_RUN_STAT") := [0,1,2,3,4];
InputForceData := [0,2,0,6,1,0,0,0,3];
END_CONNECTION