cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Add flag to Regex Match() to find all non-overlapping occurances of pattern

From time to time I have to look matches from long strings and usually regex is the method I will (would) use for. Below is an example where I try to find all words starting with f

Names Default To Here(1);

str2 = "which foot or hand fell fastest";
show(Regex(str2, "f[a-z]+")); // wanted result {"foot", "fell", "fastest"}

This will return me only the first match ("foot"). I would request a flag to be added, which could be used to find all possible non-overlapping occurrences, in similar manner as Python's re.findall works.

 

4 Comments
hogi
Level XII
show(Regex Match(str2, "(f[a-z]+)(t)","/1"));

right?

 

Funny that Regex has this option GLOBALREPLACE, but Regex Match doesn't have an option GLOBALMATCH?

hogi
Level XII

@mia_stephens , this wish could be merged with 

Regex: add options for all flags 

 

I am interested in Multiline + Global for Regex Match

hogi
Level XII

as an alternative, one could use Python, if functionality is missing in JMP,

https://community.jmp.com/t5/Discussions/Regex-can-t-get-all-parts-of-the-string-that-match/m-p/7470... 

 

... and focus on topics, where it's not possible to use Python as a replacement:
topics related to user experience , i.e. improvements for Graph Builder and interactive features


Status changed to: Acknowledged

Hello! I have noted that these wishes are related, but we don't typically merge wishes, and it doesn't seem like they are duplicates. I will leave both open for now. Thanks!