I have some very "messy" strings that come in like this:
CR 722-2018CR7222018-CR 7222018
I need them converted into something like this:
CP-41-CR-0000722-2018
All three of the above would wind up looking like this.
I was curious if there was a way to accomplish this with RegEx? The format would look something like:
CP-41-CR-(\n{7})-(\n{4}).
Is this something that can be done with RegEx?
"T0e1s2t3S4t5r6i7n8g9h10e11r12e13".Where(Char.IsDigit).Take(7)A simple.Where(Char.IsDigit).Take(7)should do the job Is the CR important does it vary? Do you need to pad with 0 the 722 part or does it range from 001-999? Some test case to cover all edge case would be nice..CR 72220-18" will give a valid "CP-41-CR-0072220-18"?