Hi
I was trying multiple options using Regex. Replace for removing the Alphabets from Alphanumeric string and also restricting the overall length of Alphanumeric field to 5.
Few examples to explain result I want to achieve.
1. SAMY1456170911---- I want this field which has overall length of 14 to processed to give output as 14561
So basically i need the alphabets removed and also get only 5 digits from where last alphabet is located in that word
2. TOMY5617 -- The output should be 5617, since the alphabets are need to be removed and there are only 4 digits after alphabets so I need same.
3. CATY156710 - The output should be 15671, since alphabets are removed and I just need to restrict to 5 digits after alphabet.
I tried this format RIGHT(Regex.Replace(input, "[A-Za-z]", "") , 8) , but it doesnt get rid of Alphabets
I was trying multiple options using Regex. Replace for removing the Alphabets from Alphanumeric string and also restricting the overall length of Alphanumeric field to 5.
Few examples to explain result I want to achieve.
1. SAMY1456170911---- I want this field which has overall length of 14 to processed to give output as 14561
So basically i need the alphabets removed and also get only 5 digits from where last alphabet is located in that word
2. TOMY5617 -- The output should be 5617, since the alphabets are need to be removed and there are only 4 digits after alphabets so I need same.
3. CATY156710 - The output should be 15671, since alphabets are removed and I just need to restrict to 5 digits after alphabet.
I tried this format RIGHT(Regex.Replace(input, "[A-Za-z]", "") , 8) , but it doesnt get rid of Alphabets