cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
tsl
tsl
Level III

How can I make Eval Insert ignore the ^ character ?

I have a situation where I need to build a string that will be passed to an external program. I need to use Eval Insert in building the string but the string also needs to contain a RegEx which includes the ^ character.

I am struggling to get JMP ( Version 19.1.4) to ignore that character in the Eval Insert call. Here is a sample :

Str_To_Eval = "Insert_Str";
str = "This is a String containing ^Str_To_Eval^ and it also contains this regex : ^(?!.*_).*";
eval insert(str)

This fails with the error :

Unexpected "?". Perhaps there is a missing ")".
Line 1 Column 37: (?!.*_).*►

Prefixing the ^ character with \! does not help. Neither does wrapping it in \[ ..]\

I can solve it like this :

Str_To_Eval = "Insert_Str";
RegExFragment = "^";
str = "This is a String containing ^Str_To_Eval^ and it also contains this regex : ^RegExFragment^(?!.*_).*";
eval insert(str);

which gives the output I want.

I was curious if there's any other way to escape a ^ character so that Eval Insert() would ignore it ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How can I make Eval Insert ignore the ^ character ?

Use different character than ^. I usually use ¤.

Names Default To Here(1);
Eval Insert("Today is ¤As Date(Today())¤", "¤");

Eval Insert(string, <startDel>, <endDel>, < <<Use Locale(1) >) 

jthi_0-1786556100491.png

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How can I make Eval Insert ignore the ^ character ?

Use different character than ^. I usually use ¤.

Names Default To Here(1);
Eval Insert("Today is ¤As Date(Today())¤", "¤");

Eval Insert(string, <startDel>, <endDel>, < <<Use Locale(1) >) 

jthi_0-1786556100491.png

 

-Jarmo
tsl
tsl
Level III

Re: How can I make Eval Insert ignore the ^ character ?

Thanks ! I can't believe I've been using JMP for ~ 2 decades and never realized Eval Insert() had an optional argument to specify the delimiter ! Sometimes it pays to read the manual :)

Recommended Articles