Posted on: 9/19/2014 10:27:30 PM | Views : 360

I am pulling my hair out trying to write a Regex that will match the characters between the X and Y in the string below.
XaaXbbXccY  (in this case i want the "cc")
The Xs and Y are constant.  All other characters (e.g., the "aa" "bb" and "cc") can vary.  I want any characters between the X and Y. 
X(.*?)Y and X(.*?)(?=Y) both undesirably return aaXbbXcc
Note: the string may be part of a larger paragraph, so not sure I can use $ or \z
Hope I have been clear. Thanks in advance!

Go to the complete details ...