cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

Regex: disable singleline option

How do I have to adjust a Regex search such that it just finds "bc" in the first line?

 

According to Regex web test pages( https://regex101.com/ , https://regexr.com/)

the regex expression "\A.*bc" should find "bc" in the first line - and ignore bc in the second line:

hogi_0-1697456290910.png       hogi_1-1697456819242.png

 

 

In Jmp with

Regex(
"abcdef
nghibcjk", "\A.*bc" );

I get the result

hogi_2-1697456878288.png

... which corresponds to Regex with additional option /s (singleline):

hogi_3-1697457005608.png

 

How can I disable the singleline option?

I just found options for 

hogi_4-1697457079992.png

.. .and for the greedy option  which can be disabled by using .*? instead of .*.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XIII

Re: Regex: disable singleline option

Thanks, @jthi 
I hoped the answer would be different. Interesting ...

Hm, here is the wish to fix it:

Regex: add options for all flags 

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Regex: disable singleline option

I don't think JMP's Regex() function supports any (general) regex flags outside of IGNORECAS (I think g, i, m and s are the most useful flags (Advanced searching with flags (mozilla.org)). I have made wish list item regarding global search, though it was hastily done and was just for Regex Match Add flag to Regex Match() to find all non-overlapping occurances of pattern . Luckily these are fairly easy to workaround most of the time.

-Jarmo
hogi
Level XIII

Re: Regex: disable singleline option

Thanks, @jthi 
I hoped the answer would be different. Interesting ...

Hm, here is the wish to fix it:

Regex: add options for all flags 

Recommended Articles