Determine if word from alteration list exists and set next condition accordingly
A not-so-clear title, I know...
Here is what I'm looking for in RegEx (C#): I have two alteration lists, say (aa|bb) & (xx|yy). I want to set the second list's prefix according to the whether there is an item from the first list before it.
For example, if there is a string from the first list, then the second list should be prefixed by j or p.
If not - it should be prefixed by o or t.
aa jxx <- Match aa pyy <- Match bb nxx <- Does not match oxx <- Match jxx <- Does not match
How can I achieve that in RegEx?
Try this :
Hint : All I did was to "translate" your specification into regex. :-)
Try this one:
Basically it has two main regex condition separated by a pipe(|). ((aa|bb)\s+[jp](xx|yy)) and ([ot](xx|yy))