<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to return all matched results from Regex? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865869#M102893</link>
    <description>&lt;P&gt;To my knowledge just using Regex (or Regex Match) are not able to do it at the moment,&amp;nbsp;&lt;LI-MESSAGE title="Add flag to Regex Match() to find all non-overlapping occurances of pattern" uid="582080" url="https://community.jmp.com/t5/JMP-Wish-List/Add-flag-to-Regex-Match-to-find-all-non-overlapping-occurances/m-p/582080#U582080" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;. You could use Python but you can also use JSL with a loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
string = "I am looking for ^this^, ^that^, and sometimes ^those^.";
result = Regex(string, "\^([^\n]*?)\^"); // Only returns first match.

matches = {};

While(!Is Missing(result = Regex(string, "\^([^\n]*?)\^")),
	Substitute Into(string, result, "");
	Insert Into(matches, result);
);

show(matches);&amp;nbsp;//&amp;nbsp;matches = {"^this^", "^that^", "^those^"};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or the &lt;STRONG&gt;much more complicated&lt;/STRONG&gt; option of JMPs "own" pattern matching &lt;A href="https://www.jmp.com/support/help/en/18.2/#page/jmp/pattern-matching.shtml#ww447620" target="_self"&gt; Scripting Guide &amp;gt; Types of Data &amp;gt; Pattern Matching&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Apr 2025 19:58:13 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-04-04T19:58:13Z</dc:date>
    <item>
      <title>How to return all matched results from Regex?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865824#M102885</link>
      <description>&lt;P&gt;How can I return all results from a Regex search?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using JMP 18.1.2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
string = "I am looking for ^this^, ^that^, and sometimes ^those^.";
result = Regex( string, "\^([^\n]*?)\^" );&amp;nbsp;//&amp;nbsp;Only&amp;nbsp;returns&amp;nbsp;first&amp;nbsp;match.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Apr 2025 18:25:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865824#M102885</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-04-04T18:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to return all matched results from Regex?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865835#M102887</link>
      <description>&lt;P&gt;The &lt;A href="https://www.jmp.com/support/help/en/18.2/#page/jmp/regex-match-function.shtml" target="_self"&gt;&lt;STRONG&gt;Regex Match()&lt;/STRONG&gt;&lt;/A&gt; function might work.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 18:59:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865835#M102887</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2025-04-04T18:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to return all matched results from Regex?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865868#M102892</link>
      <description>&lt;P&gt;Thanks for the input.&amp;nbsp; Regex Match() still does not return all results.&amp;nbsp; At least not the way I have written it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
string = "I am looking for ^this^, ^that^, and sometimes ^those^.";

result = Regex( string, "\^([^\n]*?)\^" ); // Returns "^this^".
Show( result );

results = Regex Match( string, "\^([^\n]*?)\^" ); // Returns {"^this^", "this"}.
Show( results );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Apr 2025 19:54:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865868#M102892</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-04-04T19:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to return all matched results from Regex?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865869#M102893</link>
      <description>&lt;P&gt;To my knowledge just using Regex (or Regex Match) are not able to do it at the moment,&amp;nbsp;&lt;LI-MESSAGE title="Add flag to Regex Match() to find all non-overlapping occurances of pattern" uid="582080" url="https://community.jmp.com/t5/JMP-Wish-List/Add-flag-to-Regex-Match-to-find-all-non-overlapping-occurances/m-p/582080#U582080" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;. You could use Python but you can also use JSL with a loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
string = "I am looking for ^this^, ^that^, and sometimes ^those^.";
result = Regex(string, "\^([^\n]*?)\^"); // Only returns first match.

matches = {};

While(!Is Missing(result = Regex(string, "\^([^\n]*?)\^")),
	Substitute Into(string, result, "");
	Insert Into(matches, result);
);

show(matches);&amp;nbsp;//&amp;nbsp;matches = {"^this^", "^that^", "^those^"};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or the &lt;STRONG&gt;much more complicated&lt;/STRONG&gt; option of JMPs "own" pattern matching &lt;A href="https://www.jmp.com/support/help/en/18.2/#page/jmp/pattern-matching.shtml#ww447620" target="_self"&gt; Scripting Guide &amp;gt; Types of Data &amp;gt; Pattern Matching&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 19:58:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865869#M102893</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-04-04T19:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to return all matched results from Regex?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865876#M102897</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 20:11:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865876#M102897</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-04-04T20:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to return all matched results from Regex?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865879#M102899</link>
      <description>&lt;P&gt;Using JMP's Word() function along with Jarmo's methodology one can also solve the problem.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
string = "I am looking for ^this^, ^that^, and sometimes ^those^.";
result = Regex(string, "\^([^\n]*?)\^"); // Only returns first match.

matches = {};

While(!Is Missing(result = word(2,string, "^")),
	Substitute Into(string, "^"||result||"^", "");
	Insert Into(matches, result);
);

show(matches); // matches = {"^this^", "^that^", "^those^"};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;matches = {"this", "that", "those"};&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Apr 2025 21:47:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-all-matched-results-from-Regex/m-p/865879#M102899</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-04-04T21:47:35Z</dc:date>
    </item>
  </channel>
</rss>

