Lets try again. I need to get VALUE directly behind BLAH_X. BLAH_X is EVERYWHERE however i have known KEYS. So i would like to use regex to find the VALUE directly behind BLAH_X. The way i am doing this now matches DUMMY which is directly before blahx instead of the value which is directly behind the blahx behind the known KEY.
I have been given a file that has its string like this
blah blah DUMMY blahX blah DUMMY blah blah VALUE blahX junk random junk blahY KEY
blah blah DUMMY blahX blah DUMMY blah blah junk blahX junk random junk
blah blah DUMMY blahX blah DUMMY blah blah VALUE blahX junk random junk blahY KEY
Some values/keys are optional, i cannot depend on order. With regular expressions using C# how do i write an regex that takes the value directly behind the key? I know i could write it in such a way it will match the first DUMMY but i cant think of how to make the VALUE instead.
-edit- I didnt realize the question was unclear. The example above is less complex then mine (edit to make it more complex). Basically VALUE can be any number of words behind key. However, there are known keys and the value is ALWAYS directly behind blahX.