I'm working on a regular expression (in .Net) that needs to mark subexpressions. Sample inputs are:
- EFBCFEyy
- EFBQFEyyQ
- EFBQFE yy Q
- EFBMFEyyMM
- EFByyMFEMM
What I need is to pull out all of the sub-expressions delineated by "yy" or "MM". The expression I've got so far works for the first few strings, but not the final pair. There may be spaces, which get grouped in with the non-date-format characters around them.
With "/" to separate the subexpressions, this is what I'm looking for (respectively), with the parts in bold being the ones I need to manipulate after the RegEx has evaluated:
- EFBCFE/yy
- EFBQFE/yy/Q
- EFBQFE /yy/ Q
- EFBMFE/yy/MM
- EFB/yy/MFE/MM
Here's what I have that works for the first three:
(.*)(yy|MM)(.*)
What am I missing?