Hi there
With shell script I'm trying to split the string into two parts. One is alphanumeric part, the other one is a numeric part.
dummy_postcode_1 = 'SL1'
--> res_alpha = 'SL' and res_numeric = '1'
dummy_postcode_2 = 'S053'
--> res_alpha = 'S' and res_numeric = '053'
dummy_postcode_3 = 'SO5R3'
--> res_alpha = 'SO5R' and res_numeric = '3'
dummy_postcode_4 = 'SO53R'
--> res_alpha = 'SO53R' and res_numeric = ''
dummy_postcode_5 = '783652'
--> res_alpha = '' and res_numeric = '783652'
The logic of splitting these postcode strings is the rightmost alphanum character it seems and I could do that with the character checking but it seems to me this type of coding is a bit silly to do so.
Could you advise me how i can split them into two parts by using regex?
Thanks in advance,
Ozgur