Issue
This Content is from Stack Overflow. Question asked by Grant
Real Data:
19GMC TRNLLBLK
98CHY TK GRN
02TOYO 4DWHI
21LAND BLK
To Help Visual What I’m Trying to Do:
19|GMC |TRN|LL|BLK
98|CHY |TK | |GRN
02|TOYO| |4D|WHI
21|LAND| | |BLK
Columns:
Always two digits
Always 3 letters followed by a space or 4 letters
Always all spaces, 2 letters followed by a space or 3 letters
Always all spaces or two characters
Always all spaces or three letters
I’m trying to use RegEx to select the non-white space characters within each “column”.
The non-white characters would be part of a group (one for each column).
The white characters would be part of a non-selected group.
(?<DIG>d{2})(?<MKE>S{3,4})
I can’t figure out how to create a non-selected group that figures out how many white spaces to select to prevent going into the “next column”
Thanks for any help!
Solution
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.
This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.