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. ET 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
paulp
Level III

select text between delimiters

Hello,  I'm trying to write a formula to select text that lies between the delimiters [ ].

All text in my column appears as below:

RinseAid[Apex.Rinse]*(Temp-130)

RinseAid[AutoDri]*(Temp-130)

RinseAid[Bright&Dry]*(Temp-130)

RinseAid[Clarity]*(Temp-130)

...

I want to keep only the text between the [ ] symbols:

Apex.Rinse

AutoDri

Bright&Dry

Clarity

But using a formula such as below, Iget a mesage that the formula requires a character

Starts With( :Term, "[" ),

Any ideas?  thanks, Paul


1 REPLY 1
ms
Super User (Alumni) ms
Super User (Alumni)

Re: select text between delimiters

Starts with() returns 0 or 1.  If that is part of a formula that require character argument, that could explain the error message. However, Starts with() alone would not give that error if :Term is a character column.

In this case,  the Word() function should work.

Paste this into a column formula

Word( 2, :Term, "[]" )

Or if you want to replace the values in the :Term column, try running this script (assumes there is always some text before "[")

For Each Row( :Term = Word( 2, :Term, "[]" ) );


Regex() can also be used and allows a more fool-proof search. However, here it requires some extra effort since \[ and \] have special but different meaning in jsl and grep.

But this should work:

regex(:Term,"\[\[(.+?)\]\]","\1");

Message was edited by: Marcus Sundbom
Added Regex()

Recommended Articles