cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
IMG0318
Level I

How do I isolate a character string of only numbers with varying starts and ends?

Hello,

 

I am trying to isolate only the 12 digit string for each Name to give me what you see in column Name 1. Is there a regex formula I could use to take care of the front and back end? Any help would be appreciated. Thanks!

jmp.PNG

1 REPLY 1
jthi
Super User

Re: How do I isolate a character string of only numbers with varying starts and ends?

something like \d{12} might work

Names Default To Here(1);

a = "0123456789123 123";
b = "123 0123456789123";

Show(Regex(a, "\d{12}"));
Show(Regex(b, "\d{12}"));

https://regex101.com/r/eDxvy8/1

-Jarmo