I’m trying to figure out how to write a pattern that can match to both “3Z10Z” and “3Z 10Z”, and then return “3Z”. (Later I will write the pattern to return the 10Z part…).
I tried using something like @"\d+Z\s*\B" to try and grab the first part, but no dice. One thought I have, if its possible, is for it to read left to right and return the first @”\d+Z” it finds. To later get the “10Z” part I would need it to read from right to left though…
Any help is much appreciated!
Have you tried
@"(\d[A-Z])\s*(.*)"?If you run the program below you can capture both the prefix and suffix in one shot
Basically a digit followed by upper case letter.