<?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 Can I use Contains () with wildcard? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Can-I-use-Contains-with-wildcard/m-p/422297#M67139</link>
    <description>&lt;P&gt;I have a list as an output from a JSL script. The list is of the form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{"John.01.02", "John.01.02 2"," John.01.02 3", "John.01.02 4", "John.01.02 5 Distribution", "John.01.02 6 Distribution", "John.01.02 7 Distribution", "John.01.02 8 - Graph Builder", "John.01.02 9 - Graph Builder", "John.01.02 10 - Graph Builder"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to do an operation&amp;nbsp;&lt;EM&gt;if&amp;nbsp;&lt;/EM&gt; the word "Distribution" appears in above list and another operation &lt;I&gt;if&amp;nbsp;&lt;/I&gt; the word "Graph Builder" occurs while looping through the items in the list. I am thinking of using the contains() function on the lines of&lt;/P&gt;&lt;PRE&gt;if (Contains(list, "Distribution"),&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;,do something);&lt;BR /&gt;else do something else.&lt;/P&gt;&lt;P&gt;However, I am unable to select the correct list items within the list and was wondering if I can use a wildcard and write on the lines of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;if (Contains(list, "&lt;STRONG&gt;Distribution*&lt;/STRONG&gt;"),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which clearly does not work.&lt;/P&gt;&lt;P&gt;If a wildcard is possible within the contains() function what is the syntax?&lt;/P&gt;&lt;P&gt;If not, how to achieve the operations I am am looking for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 19:58:02 GMT</pubDate>
    <dc:creator>Neo</dc:creator>
    <dc:date>2023-06-09T19:58:02Z</dc:date>
    <item>
      <title>Can I use Contains () with wildcard?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-I-use-Contains-with-wildcard/m-p/422297#M67139</link>
      <description>&lt;P&gt;I have a list as an output from a JSL script. The list is of the form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{"John.01.02", "John.01.02 2"," John.01.02 3", "John.01.02 4", "John.01.02 5 Distribution", "John.01.02 6 Distribution", "John.01.02 7 Distribution", "John.01.02 8 - Graph Builder", "John.01.02 9 - Graph Builder", "John.01.02 10 - Graph Builder"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to do an operation&amp;nbsp;&lt;EM&gt;if&amp;nbsp;&lt;/EM&gt; the word "Distribution" appears in above list and another operation &lt;I&gt;if&amp;nbsp;&lt;/I&gt; the word "Graph Builder" occurs while looping through the items in the list. I am thinking of using the contains() function on the lines of&lt;/P&gt;&lt;PRE&gt;if (Contains(list, "Distribution"),&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;,do something);&lt;BR /&gt;else do something else.&lt;/P&gt;&lt;P&gt;However, I am unable to select the correct list items within the list and was wondering if I can use a wildcard and write on the lines of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;if (Contains(list, "&lt;STRONG&gt;Distribution*&lt;/STRONG&gt;"),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which clearly does not work.&lt;/P&gt;&lt;P&gt;If a wildcard is possible within the contains() function what is the syntax?&lt;/P&gt;&lt;P&gt;If not, how to achieve the operations I am am looking for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:58:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-I-use-Contains-with-wildcard/m-p/422297#M67139</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-09T19:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use Contains () with wildcard?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-I-use-Contains-with-wildcard/m-p/422336#M67142</link>
      <description>&lt;P&gt;Using Contains() to search through a list, will find only complete matches.&amp;nbsp; However, searching through a string, using a Contains() it will find strings that have the search criteria anywhere within the string.&amp;nbsp; &amp;nbsp;So you can get what you want with the method in the following script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
theList = {"John.01.02", "John.01.02 2", " John.01.02 3", "John.01.02 4",
"John.01.02 5 Distribution", "John.01.02 6 Distribution", "John.01.02 7 Distribution",
"John.01.02 8 - Graph Builder", "John.01.02 9 - Graph Builder", "John.01.02 10 - Graph Builder"};
For( i = 1, i &amp;lt;= N Items( theList ), i++,
	If( Contains( theList[i], "Distribution" ),
		Break()
	)
);
If( i &amp;lt;= N Items( theList ),
	Show( theList[i] )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Sep 2021 00:09:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-I-use-Contains-with-wildcard/m-p/422336#M67142</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-30T00:09:14Z</dc:date>
    </item>
  </channel>
</rss>

