I have developed a regex to use in a .NET WebAPI that gets a date and a control code from a given input already formatted in final format.
I tried regex to avoid using multiple string splits.
I've been using Regex101 to test my expression and I have one that already works as expected by I think it's too large for what it does.
Expression:
^([0-9]{2})+([0-9]{2})+([0-9]{2})[0-9](M|F)([0-9]{2})+([0-9]{2})+([0-9]{2})
// Get in format Year, Month, Day, Code(M|F), Year, Month, Day
Input:
7603259M2209058PRT<<<<<<<<<<<8
Do you have any suggestions to simplify it?