cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles