<?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: Extract text from string in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450649#M69750</link>
    <description>&lt;P&gt;Pattern matching you say? How about this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

sample = "\\swirt.misc@CAS-K-CLERK\K10447-Wit_OG lo hi TT-YYT (CTL1083.1)_172-7-10053 -303
\\swirt.misc@CAS-K-CLERK\K10445-Wit_OG lo hi ES WERT (CIL0858.1)_172-7-10046-600
\\swirt.misc@CAS-K-CLERK\K10437-Wit_OG lo hi TT-YYT (CTL1077.1)_172-7-10053-303
\\swirt.misc@CAS-K-CLERK\K10420-Wit_OG lo hi ES TRTR (CMA0851.1)_172-7-10047-600
\\swirt.misc@CAS-K-CLERK\K10377-Wit_OG_lo hi_ES_SI (CMS0499.1)_ 172-7-10041-600
\\swirt.misc@CAS-K-CLERK\K10451-Wit_OG lo hi TT-YYT (CTL1078
\\swirt.misc@CAS-K-CLERK\K10468-Wit_OG lo hi YYT DEV-020856 (CTLR1073
\\swirt.misc@CAS-K-CLERK\K10022 -Wit_OG lo hi YYT DEV-020414 (CTLR0999.1)
\\swirt.misc@CAS-K-CLERK\K10030-Wit_OG lo hi TT-YYT (CTL1008.1)";

charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.";

idList = {};
Pat Match(sample,"(" + Pat Span(charSet)&amp;gt;&amp;gt;nextID + (")" | "\!r") + Pat Test(Insert Into(idList,nextID);0));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's unfortunate there isn't more support documentation for learning how to use pattern matching. I was a "Why bother with pattern matching when you have Regex?" person until I started to gain a better understand and appreciation for it (thank you &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;!). It is blazingly fast and compact. To explain the code above, &lt;FONT face="courier new,courier"&gt;Pat Match&lt;/FONT&gt; is looking for an open parenthesis followed by one or more characters from &lt;FONT face="courier new,courier"&gt;charSet&lt;/FONT&gt; followed by the close parenthesis or a carriage return. The results from &lt;FONT face="courier new,courier"&gt;Pat Span&lt;/FONT&gt; are stored in the variable &lt;FONT face="courier new,courier"&gt;nextID&lt;/FONT&gt;. Each time the pattern is found, &lt;FONT face="courier new,courier"&gt;Pat Test&lt;/FONT&gt; is used to insert it into &lt;FONT face="courier new,courier"&gt;idList&lt;/FONT&gt;. The &lt;FONT face="courier new,courier"&gt;0&lt;/FONT&gt; at the end of &lt;FONT face="courier new,courier"&gt;Pat Test&lt;/FONT&gt; lets you continue searching the input string from the position immediately after the last character in the matched string (but before the next character). If the last statement in &lt;FONT face="courier new,courier"&gt;Pat Test&lt;/FONT&gt; had evaluated to true (anything not 0) the search would have ended, returning just the first match.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2022 22:04:27 GMT</pubDate>
    <dc:creator>DonMcCormack</dc:creator>
    <dc:date>2022-01-11T22:04:27Z</dc:date>
    <item>
      <title>Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450420#M69722</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If possible I would like extract particular text from the strings:&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10447-Wit_OG lo hi TT-YYT (CTL1083.1)_172-7-10053 -303&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10445-Wit_OG lo hi ES WERT (CIL0858.1)_172-7-10046-600&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10437-Wit_OG lo hi TT-YYT (CTL1077.1)_172-7-10053-303&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10420-Wit_OG lo hi ES TRTR (CMA0851.1)_172-7-10047-600&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10377-Wit_OG_lo hi_ES_SI (CMS0499.1)_ 172-7-10041-600&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10451-Wit_OG lo hi TT-YYT (CTL1078&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10468-Wit_OG lo hi YYT DEV-020856 (CTLR1073&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10022 -Wit_OG lo hi YYT DEV-020414 (CTLR0999.1)&lt;/P&gt;&lt;P&gt;\\swirt.misc@CAS-K-CLERK\K10030-Wit_OG lo hi TT-YYT (CTL1008.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want to extract the IDs from above:&lt;/P&gt;&lt;P&gt;CTL1083.1&lt;/P&gt;&lt;P&gt;CIL0858.1&lt;/P&gt;&lt;P&gt;CTL1077.1&lt;/P&gt;&lt;P&gt;CMA0851.1&lt;/P&gt;&lt;P&gt;CMS0499.1&lt;/P&gt;&lt;P&gt;CTL1078&lt;/P&gt;&lt;P&gt;CTLR1073&lt;/P&gt;&lt;P&gt;CTLR0999.1&lt;/P&gt;&lt;P&gt;CTL1008.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tomasz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:08:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450420#M69722</guid>
      <dc:creator>swiergi11</dc:creator>
      <dc:date>2023-06-09T18:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450440#M69724</link>
      <description>&lt;P&gt;Use the WORDS function with ( and ) as delimiters.&amp;nbsp; Use the second element in the returned list.&amp;nbsp; Run the code below and check the output in the log window.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Test Words", Add Rows( 9 ),
	New Column( "Column 1", Character, "Nominal",
		Set Values(
			{
			"\\swirt.misc@CAS-K-CLERK\K10447-Wit_OG lo hi TT-YYT (CTL1083.1)_172-7-10053 -303",
			"\\swirt.misc@CAS-K-CLERK\K10445-Wit_OG lo hi ES WERT (CIL0858.1)_172-7-10046-600",
			"\\swirt.misc@CAS-K-CLERK\K10437-Wit_OG lo hi TT-YYT (CTL1077.1)_172-7-10053-303",
			"\\swirt.misc@CAS-K-CLERK\K10420-Wit_OG lo hi ES TRTR (CMA0851.1)_172-7-10047-600",
			"\\swirt.misc@CAS-K-CLERK\K10377-Wit_OG_lo hi_ES_SI (CMS0499.1)_ 172-7-10041-600",
			"\\swirt.misc@CAS-K-CLERK\K10451-Wit_OG lo hi TT-YYT (CTL1078",
			"\\swirt.misc@CAS-K-CLERK\K10468-Wit_OG lo hi YYT DEV-020856 (CTLR1073",
			"\\swirt.misc@CAS-K-CLERK\K10022 -Wit_OG lo hi YYT DEV-020414 (CTLR0999.1)",
			"\\swirt.misc@CAS-K-CLERK\K10030-Wit_OG lo hi TT-YYT (CTL1008.1)"}
		),
		Set Display Width( 583 )
	)
);

for (i = 1, i &amp;lt;= nrows(dt), i++,
	one_value = dt:column 1[i];
	
	word_list = words(one_value, "()");
	print(word_list[2]);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 13:17:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450440#M69724</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2022-01-11T13:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450443#M69725</link>
      <description>&lt;P&gt;The solution from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;is very robust, nice!&lt;/P&gt;
&lt;P&gt;A little different approach might be to use formulas in the data table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-01-11 at 8.29.19 AM.png" style="width: 659px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38898i8115A7AD4499E905/image-dimensions/659x56?v=v2" width="659" height="56" role="button" title="Screen Shot 2022-01-11 at 8.29.19 AM.png" alt="Screen Shot 2022-01-11 at 8.29.19 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; The location of the start delimiter could be located with a "Contains" argument&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Contains(:text, "(")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The location of the end delimiter could be located the same way&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Contains( :text, ")" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;An obscure but really fun argument, "munger", could be used to extract the string between the delimiter locations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case we want the string after the delimiter character, that ends before the ending delimiter character, so 1 is added to the start and subtracted from the end.&lt;/P&gt;
&lt;P&gt;The function for munger in this case uses the arguments, whole text, where to start, how many characters to return. Munger can also do some other interesting things, like find and replace.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Munger( :text, :start + 1, (:stop - :start) - 1 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Wrapping all that up into one formula would look like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Munger(
	:text,
	Contains( :text, "(" ) + 1,
	(Contains( :text, ")" ) - Contains( :text, "(" )) - 1
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 13:37:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450443#M69725</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2022-01-11T13:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450463#M69728</link>
      <description>&lt;P&gt;I use &lt;STRONG&gt;SUBSTR&lt;/STRONG&gt; for similar effect.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for (i = 1, i &amp;lt;= nrows(dt), i++,
	one_value = dt:column 1[i];
	start  = contains(one_value, "(") + 1;
	end    = contains(one_value, ")") - 1;
	len    = end - start + 1;
	result = substr(one_value, start, len);
	print(result);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 14:42:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450463#M69728</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2022-01-11T14:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450516#M69732</link>
      <description>&lt;P&gt;In case you are into regular expressions...&amp;nbsp; &amp;nbsp;(Note: cleaned up hastily written code and replaced listing below on 1/12/22)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// make list of example original strings
sample =
"\\swirt.misc@CAS-K-CLERK\K10447-Wit_OG lo hi TT-YYT (CTL1083.1)_172-7-10053 -303

\\swirt.misc@CAS-K-CLERK\K10445-Wit_OG lo hi ES WERT (CIL0858.1)_172-7-10046-600

\\swirt.misc@CAS-K-CLERK\K10437-Wit_OG lo hi TT-YYT (CTL1077.1)_172-7-10053-303

\\swirt.misc@CAS-K-CLERK\K10420-Wit_OG lo hi ES TRTR (CMA0851.1)_172-7-10047-600

\\swirt.misc@CAS-K-CLERK\K10377-Wit_OG_lo hi_ES_SI (CMS0499.1)_ 172-7-10041-600

\\swirt.misc@CAS-K-CLERK\K10451-Wit_OG lo hi TT-YYT (CTL1078

\\swirt.misc@CAS-K-CLERK\K10468-Wit_OG lo hi YYT DEV-020856 (CTLR1073

\\swirt.misc@CAS-K-CLERK\K10022 -Wit_OG lo hi YYT DEV-020414 (CTLR0999.1)

\\swirt.misc@CAS-K-CLERK\K10030-Wit_OG lo hi TT-YYT (CTL1008.1)";
sample = Words( sample, "\!U000D" );
// Show( sample );
n = N Items( sample );

// iterate over list and return target strings
id = List();
For Each( {string}, sample, Insert Into( id, Regex( string, If( Contains( string, ")" ), "(.+\()(.+)(\).*)", "(.+\()(.+)" ), "\2" ) ) );

Show( id );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 16:01:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450516#M69732</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-01-12T16:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450525#M69734</link>
      <description>&lt;P&gt;I like the "Word()" function for such string extractions&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = New Table( "Test Words",
	Add Rows( 9 ),
	New Column( "Column 1",
		Character,
		"Nominal",
		Set Values(
			{"\\swirt.misc@CAS-K-CLERK\K10447-Wit_OG lo hi TT-YYT (CTL1083.1)_172-7-10053 -303",
			"\\swirt.misc@CAS-K-CLERK\K10445-Wit_OG lo hi ES WERT (CIL0858.1)_172-7-10046-600",
			"\\swirt.misc@CAS-K-CLERK\K10437-Wit_OG lo hi TT-YYT (CTL1077.1)_172-7-10053-303",
			"\\swirt.misc@CAS-K-CLERK\K10420-Wit_OG lo hi ES TRTR (CMA0851.1)_172-7-10047-600",
			"\\swirt.misc@CAS-K-CLERK\K10377-Wit_OG_lo hi_ES_SI (CMS0499.1)_ 172-7-10041-600",
			"\\swirt.misc@CAS-K-CLERK\K10451-Wit_OG lo hi TT-YYT (CTL1078",
			"\\swirt.misc@CAS-K-CLERK\K10468-Wit_OG lo hi YYT DEV-020856 (CTLR1073",
			"\\swirt.misc@CAS-K-CLERK\K10022 -Wit_OG lo hi YYT DEV-020414 (CTLR0999.1)",
			"\\swirt.misc@CAS-K-CLERK\K10030-Wit_OG lo hi TT-YYT (CTL1008.1)"}
		),
		Set Display Width( 583 )
	)
);

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	Print( Word( 2, dt:column 1[i], "()" ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 15:59:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450525#M69734</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-11T15:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450526#M69735</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;, your code always looks so much less haphazard than mine ; )&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Substring (substr) is a more straightforward approach, I just can't resist a good case for munger.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Craig Hales probably has some even more efficient approaches using pattern matching. I'm sure there are already some examples in the community pages or his blog page.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:33:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450526#M69735</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2022-01-11T16:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450527#M69736</link>
      <description>&lt;P&gt;Wow lots of ways to slice a loaf of bread in JMP.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:36:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450527#M69736</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2022-01-11T16:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450528#M69737</link>
      <description>&lt;P&gt;very nice, all of the suggestions works the magic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've used the Munger in my script and works perfect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Tomasz&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:38:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450528#M69737</guid>
      <dc:creator>swiergi11</dc:creator>
      <dc:date>2022-01-11T16:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450594#M69747</link>
      <description>&lt;P&gt;I like the simplicity of word() or words() when it will work. I wrote about munger &lt;A href="https://community.jmp.com/t5/Uncharted/JSL-Character-String-Functions/ba-p/21323" target="_self"&gt;here&lt;/A&gt; and no longer understand how to use it. I think it is in JMP because it was available on the Mac in 1990...not because it was an example of a good way to manipulate strings.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:31:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450594#M69747</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-01-11T21:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450649#M69750</link>
      <description>&lt;P&gt;Pattern matching you say? How about this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

sample = "\\swirt.misc@CAS-K-CLERK\K10447-Wit_OG lo hi TT-YYT (CTL1083.1)_172-7-10053 -303
\\swirt.misc@CAS-K-CLERK\K10445-Wit_OG lo hi ES WERT (CIL0858.1)_172-7-10046-600
\\swirt.misc@CAS-K-CLERK\K10437-Wit_OG lo hi TT-YYT (CTL1077.1)_172-7-10053-303
\\swirt.misc@CAS-K-CLERK\K10420-Wit_OG lo hi ES TRTR (CMA0851.1)_172-7-10047-600
\\swirt.misc@CAS-K-CLERK\K10377-Wit_OG_lo hi_ES_SI (CMS0499.1)_ 172-7-10041-600
\\swirt.misc@CAS-K-CLERK\K10451-Wit_OG lo hi TT-YYT (CTL1078
\\swirt.misc@CAS-K-CLERK\K10468-Wit_OG lo hi YYT DEV-020856 (CTLR1073
\\swirt.misc@CAS-K-CLERK\K10022 -Wit_OG lo hi YYT DEV-020414 (CTLR0999.1)
\\swirt.misc@CAS-K-CLERK\K10030-Wit_OG lo hi TT-YYT (CTL1008.1)";

charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.";

idList = {};
Pat Match(sample,"(" + Pat Span(charSet)&amp;gt;&amp;gt;nextID + (")" | "\!r") + Pat Test(Insert Into(idList,nextID);0));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's unfortunate there isn't more support documentation for learning how to use pattern matching. I was a "Why bother with pattern matching when you have Regex?" person until I started to gain a better understand and appreciation for it (thank you &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;!). It is blazingly fast and compact. To explain the code above, &lt;FONT face="courier new,courier"&gt;Pat Match&lt;/FONT&gt; is looking for an open parenthesis followed by one or more characters from &lt;FONT face="courier new,courier"&gt;charSet&lt;/FONT&gt; followed by the close parenthesis or a carriage return. The results from &lt;FONT face="courier new,courier"&gt;Pat Span&lt;/FONT&gt; are stored in the variable &lt;FONT face="courier new,courier"&gt;nextID&lt;/FONT&gt;. Each time the pattern is found, &lt;FONT face="courier new,courier"&gt;Pat Test&lt;/FONT&gt; is used to insert it into &lt;FONT face="courier new,courier"&gt;idList&lt;/FONT&gt;. The &lt;FONT face="courier new,courier"&gt;0&lt;/FONT&gt; at the end of &lt;FONT face="courier new,courier"&gt;Pat Test&lt;/FONT&gt; lets you continue searching the input string from the position immediately after the last character in the matched string (but before the next character). If the last statement in &lt;FONT face="courier new,courier"&gt;Pat Test&lt;/FONT&gt; had evaluated to true (anything not 0) the search would have ended, returning just the first match.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 22:04:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450649#M69750</guid>
      <dc:creator>DonMcCormack</dc:creator>
      <dc:date>2022-01-11T22:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450877#M69775</link>
      <description>&lt;P&gt;Shh!&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;, please don't tell&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4386"&gt;@Byron_JMP&lt;/a&gt;. You will really hurt his feelings. (Thin skin I'm afraid)&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 16:12:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-text-from-string/m-p/450877#M69775</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-01-12T16:12:39Z</dc:date>
    </item>
  </channel>
</rss>

