cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

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