So I currently have this which I believe works but it is quite long. I'm using C# regex.
^(:?J)$|^(:?J)$|^(:?F)$|^(:?M)$|^(?:A)$|^(?:A)$|^(?:S)$|^(?:O)$|^(?:N)$|^(?:D)$|^(:?JA)$|^(:?JU)$|^(:?FE)$|^(:?MA)$|^(?:AP)$|^(?:AU)$|^(?:SE)$|^(?:OC)$|^(?:NO)$|^(?:DE)$|^(:?JAN)$|^(:?FEB)$|^(:?MAR)$|^(:?APR)$|^(?:MAY)$|^(?:JUN)$|^(?:JUL)$|^(?:AUG)$|^(?:SEP)$|^(?:OCT)$|^(?:NOV)$|^(?:DEC)$
Is there any way to make this shorter? I think it is already pretty straightforward but if there is a way to combine what I have here into a shorter regex that is what I am after.
I need it to match the combinations of first letter only, first and second, and all three letters of the month abbreviations.
First Letter only. ^(:?J)$|^(:?J)$|^(:?F)$|^(:?M)$|^(?:A)$|^(?:A)$|^(?:S)$|^(?:O)$|^(?:N)$|^(?:D)$
First and Second letter combinations are matched by this. ^(:?JA)$|^(:?JU)$|^(:?FE)$|^(:?MA)$|^(?:AP)$|^(?:AU)$|^(?:SE)$|^(?:OC)$|^(?:NO)$|^(?:DE)$
Full abbreviations: |^(:?JAN)$|^(:?FEB)$|^(:?MAR)$|^(:?APR)$|^(?:MAY)$|^(?:JUN)$|^(?:JUL)$|^(?:AUG)$|^(?:SEP)$|^(?:OCT)$|^(?:NOV)$|^(?:DEC)$
Then I combined those regexes into the one I have at the top... which now works as I intend it to However it is still rather huge and I imagine I can be improved.
|\Z
by$
which means "end of string" as^
means "begining of string" - Casimir et Hippolyte