regex substring C#
- by sharma
Hi,
I need help to figure the regex expression
I have
string = "STATE changed from [Fixed] to [Closed], CLOSED DATE added [Fri Jan 14 09:32:19
MST 2011], NOTES changed from [CLOSED[]<br />] to [TEST CLOSED <br />]"
I need to grab NOTES changed from [CLOSED[]<br />] to [TEST CLOSED <br />] and take values CLOSED[] and TEST CLOSED in two string variables.
So far I got to:
Regex NotesChanged = new Regex(@"NOTES changed from \[(\w*|\W*)\] to \[([\w-|\W-]*)\]");
which matches only if "NOTES changed from" started at the beginning and has no '[]' within '[ ]', but I have "[CLOSED[]]" and also no "".
Any ideas on what to change in regex.
Thanks,
Sharma