<?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: Regex to remove text from string in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650534#M84180</link>
    <description>&lt;P&gt;Yep it looks like return 2 gets me what I need. I should have mentioned that I inteded to split the items separated by commas into columns using the text to columns function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, jthi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 20:30:26 GMT</pubDate>
    <dc:creator>FeralCass</dc:creator>
    <dc:date>2023-06-22T20:30:26Z</dc:date>
    <item>
      <title>Regex to remove text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650510#M84178</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to remove specific text from a string using regex. The cell contents contain one or more items separated by commas with "not detected" at the end. I'd like to remove "not detected"&amp;nbsp; to leave just the items listed that can be split by the comma. What I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regex( Substitute( :"DETAILS"n, "not detected", "" ), "\S*" )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this appears to be truncating the list wherever there is a space, so "item A, item B not detected" becomes "item" where I would like to have "item A, item B."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose I can work around it by removing spaces first, but would like to keep in more concise if possible.&amp;nbsp;Is there a modification that would return the list and only remove the "not detected"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cass&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 19:59:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650510#M84178</guid>
      <dc:creator>FeralCass</dc:creator>
      <dc:date>2023-06-22T19:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to remove text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650520#M84179</link>
      <description>&lt;P&gt;Is return3 what you are looking for?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = "item A, item B not detected";

return1 = Regex(Substitute(str, "not detected", ""), "\S*");
return2 = Substitute(str, "not detected", "");
return3 = Words(Substitute(str, " not detected", ""), ",");

show(return1, return2, return3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can just replace the one additional space with substitute and to split into a list use Words() with "," as separator&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 20:07:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650520#M84179</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-22T20:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to remove text from string</title>
      <link>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650534#M84180</link>
      <description>&lt;P&gt;Yep it looks like return 2 gets me what I need. I should have mentioned that I inteded to split the items separated by commas into columns using the text to columns function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, jthi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 20:30:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Regex-to-remove-text-from-string/m-p/650534#M84180</guid>
      <dc:creator>FeralCass</dc:creator>
      <dc:date>2023-06-22T20:30:26Z</dc:date>
    </item>
  </channel>
</rss>

