<?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 use jsl to test if a string contains only A~Z and 0~9? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/573214#M78217</link>
    <description>&lt;P&gt;Thank you&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt; for the instructions. Very useful with some particularly dirty data.&lt;/P&gt;
&lt;P&gt;If anyone else needs a handy example try the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Regex( :"2nd"n, "^[A-Z]+$" ) == :"2nd"n, "Uppercase",
	Regex( :"2nd"n, "^[a-z]+$" ) == :"2nd"n, "Lowercase",
	Regex( :"2nd"n, "^[0-9]+$" ) == :"2nd"n, "Numbers",
	Regex( :"2nd"n, "^[A-Z0-9]+$" ) == :"2nd"n, "Uppercase and numbers",
	Regex( :"2nd"n, "^[a-z0-9]+$" ) == :"2nd"n, "lowercase and numbers",
	Regex( :"2nd"n, "^[A-Za-z]+$" ) == :"2nd"n, "No numbers",
	Regex( :"2nd"n, "^[A-Za-z0-9]+$" ) == :"2nd"n, "All characters",
	Regex( :"2nd"n, "^[A-Za-z0-9]+$" ) != :"2nd"n,
		"includes non alphanumeric characters"
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ron_horne_0-1669302873804.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47599i754C1E61970A32BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ron_horne_0-1669302873804.png" alt="ron_horne_0-1669302873804.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 15:17:29 GMT</pubDate>
    <dc:creator>ron_horne</dc:creator>
    <dc:date>2022-11-24T15:17:29Z</dc:date>
    <item>
      <title>how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8032#M8026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to use jsl to test if a string contains only A~Z and 0~9?&lt;/P&gt;&lt;P&gt;my data shall&amp;nbsp; contains only A~Z and 0~9 but when 1 or few bit flip then there is not printable characters.&lt;/P&gt;&lt;P&gt;many thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 18:51:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8032#M8026</guid>
      <dc:creator>robust1972</dc:creator>
      <dc:date>2014-01-23T18:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8033#M8027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use regular expressions to check this.&amp;nbsp; Create a new column that contains the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;Regex&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;Name&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"2nd"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"^[a-zA-Z0-9]+$"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;Name&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"2nd"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"Yes"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"No"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The new column will have the value "Yes" if it is purely alphanumeric, "No" otherwise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 19:53:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8033#M8027</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2014-01-23T19:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8034#M8028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply, PMroz.&lt;/P&gt;&lt;P&gt;What ^ and +$ for?&lt;/P&gt;&lt;P&gt;how can I make it return 1 or 0 so that I could use it together with other comparison algorithm?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 22:37:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8034#M8028</guid>
      <dc:creator>robust1972</dc:creator>
      <dc:date>2014-01-23T22:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8035#M8029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ^ means the start of the string, the + means to match at least one character, and the $ means the end of the string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To return a 1 or 0 simply change Yes to 1 and No to 0:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: #0000dd;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt; &lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: #0000dd;"&gt;Regex&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: navy;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;Name&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: purple;"&gt;"2nd"&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: purple;"&gt;"^[a-zA-Z0-9]+$"&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: navy;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: navy;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;Name&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: purple;"&gt;"2nd"&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: navy;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-family: 'Courier New';"&gt;0&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: black;"&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a ton of websites out there that explain regular expressions btw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 12:03:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/8035#M8029</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2014-01-24T12:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/573214#M78217</link>
      <description>&lt;P&gt;Thank you&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt; for the instructions. Very useful with some particularly dirty data.&lt;/P&gt;
&lt;P&gt;If anyone else needs a handy example try the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Regex( :"2nd"n, "^[A-Z]+$" ) == :"2nd"n, "Uppercase",
	Regex( :"2nd"n, "^[a-z]+$" ) == :"2nd"n, "Lowercase",
	Regex( :"2nd"n, "^[0-9]+$" ) == :"2nd"n, "Numbers",
	Regex( :"2nd"n, "^[A-Z0-9]+$" ) == :"2nd"n, "Uppercase and numbers",
	Regex( :"2nd"n, "^[a-z0-9]+$" ) == :"2nd"n, "lowercase and numbers",
	Regex( :"2nd"n, "^[A-Za-z]+$" ) == :"2nd"n, "No numbers",
	Regex( :"2nd"n, "^[A-Za-z0-9]+$" ) == :"2nd"n, "All characters",
	Regex( :"2nd"n, "^[A-Za-z0-9]+$" ) != :"2nd"n,
		"includes non alphanumeric characters"
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ron_horne_0-1669302873804.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47599i754C1E61970A32BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ron_horne_0-1669302873804.png" alt="ron_horne_0-1669302873804.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 15:17:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/573214#M78217</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2022-11-24T15:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/585427#M79112</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if regex can be used in text?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Text = " today I m at FL12, tomorrow I will be at FL102"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have rows of text that I want to find out if each row contains FL + anydigit then yes, or print the FL+digit. In this case, it will be FL12 and FL103.&lt;/P&gt;&lt;P&gt;If nor Regex, can you suggest other function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 03:41:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/585427#M79112</guid>
      <dc:creator>dadawasozo</dc:creator>
      <dc:date>2022-12-28T03:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/585434#M79113</link>
      <description>&lt;P&gt;If you only need to know found or not found, it is fairly simple with one regex, if you also need the matches you need to loop over the string while substituting the found matches. Also if you need to test your Regex I suggest &lt;A href="https://regex101.com/r/HV9hQf/1" target="_blank" rel="noopener"&gt;regex101&lt;/A&gt;&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);

original_txt1 = " today I m at FL12, tomorrow I will be at FL 103";
original_txt2 = " today I m at FLb12, tomorrow I will be at FL a123";

// if you only need to know if there is a match combine regex with !IsMissing()
found1 = !Is Missing(Regex(original_txt1, "FL\s?\d+"));
found2 = !Is Missing(Regex(original_txt2, "FL\s?\d+"));
show(found1, found2);

// if you also need the matches loop over the string
matches = {};
While(!Is Missing(rgx_match = Regex(original_txt1, "FL\s?\d+")),
	Insert Into(matches, rgx_match);
	Substitute Into(original_txt1, rgx_match, "");
);
show(matches);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To my knowledge JMP cannot perform "global" regex search with Regex Match() and I have made wish list item for it&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 most likely use &lt;A href="https://www.jmp.com/support/help/en/17.1/index.shtml#page/jmp/pattern-matching.shtml" target="_blank" rel="noopener"&gt;JMP's own Pattern Matching&lt;/A&gt; to do tasks like finding multiple matches, but I haven't bothered to learn it. Here is good post about that&lt;LI-MESSAGE title="Pattern Matching" uid="21005" url="https://community.jmp.com/t5/Uncharted/Pattern-Matching/m-p/21005#U21005" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 06:21:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/585434#M79113</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-12-28T06:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to test if a string contains only A~Z and 0~9?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/585508#M79118</link>
      <description>&lt;P&gt;Thanks! The regex101 helps to understand the code you shared.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 15:55:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-test-if-a-string-contains-only-A-Z-and-0-9/m-p/585508#M79118</guid>
      <dc:creator>dadawasozo</dc:creator>
      <dc:date>2022-12-28T15:55:32Z</dc:date>
    </item>
  </channel>
</rss>

