<?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: SAS regular Expression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578660#M164159</link>
    <description>^VIST\[[-zA-Z0-9]*\]\/SSV\[[a-zA-Z0-9]*\]$</description>
    <pubDate>Fri, 02 Aug 2019 11:11:09 GMT</pubDate>
    <dc:creator>Criptic</dc:creator>
    <dc:date>2019-08-02T11:11:09Z</dc:date>
    <item>
      <title>SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578648#M164148</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some of the praxmatch are not working for some regular expressions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please tell me whats wrong with the regular expressions where it is not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input StudyEventKey:$40.;
x = prxmatch(prxparse('/^VIST\[*\]*V*\[*\]/') ,StudyEventKey);	/*Does not work*/
x1 = prxmatch(prxparse('/^VIST\[*\]*V*\[1\]/') ,StudyEventKey);
x2 = prxmatch(prxparse('/^VIST\[*\]*V*\[2\]/') ,StudyEventKey);
y = prxmatch(prxparse('/^VIST\[*\]*V*/') ,StudyEventKey);
z = prxmatch(prxparse('/^VIST\[*\]\/*V*\[*\]/') ,StudyEventKey);  /*Does not work*/
cards;
VIST[1]/FV[1]
VIST[1]/SV[1]
VIST[1]/TV[1]
VIST[2]/FV[1]
VIST[2]/SV[1]
VIST[2]/TV[1]
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Aug 2019 09:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578648#M164148</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2019-08-02T09:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578650#M164150</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138619"&gt;@Satish_Parida&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The First Statement doesn't work because you are looking for the word VISIT then for 0 to n occurences of [ that is probabely not the intended effect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like&amp;nbsp;^VIST\[\d\]*V*\[*\] would to the trick here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I highly recommend using&amp;nbsp;&lt;A href="https://regexr.com/38ed7" target="_blank"&gt;https://regexr.com/38ed7&lt;/A&gt;&amp;nbsp;to built your regex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Criptic&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 10:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578650#M164150</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-08-02T10:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578652#M164152</link>
      <description>Thank you, but x1 and x2 give correct output, that's why I am confused what is wrong with x?</description>
      <pubDate>Fri, 02 Aug 2019 10:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578652#M164152</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2019-08-02T10:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578656#M164155</link>
      <description>x1 findes the string VISIT[1] - why? because you match VISIT from the beginning, then 0 to n [, 0 to n ], 0 to n V, [, a 1 and finally a ] - so this regex finds the string VISIT[1] so this seems to work but it really doesn't do what you want.&lt;BR /&gt;&lt;BR /&gt;x2  works in the same way, except that it matches VISIT[2]&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Aug 2019 11:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578656#M164155</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-08-02T11:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578658#M164157</link>
      <description>Thank you.&lt;BR /&gt;&lt;BR /&gt;Expression: /^VIST\[*[0-9|A-Z]\]\/*[0-9|A-Z]V\[*[0-9|A-Z]\]$/ works for all the scenarios I have.&lt;BR /&gt;&lt;BR /&gt;Could you please help me with the expression, which will work for the following.&lt;BR /&gt;&lt;BR /&gt;VIST[1A]/SSV[10A]</description>
      <pubDate>Fri, 02 Aug 2019 11:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578658#M164157</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2019-08-02T11:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578660#M164159</link>
      <description>^VIST\[[-zA-Z0-9]*\]\/SSV\[[a-zA-Z0-9]*\]$</description>
      <pubDate>Fri, 02 Aug 2019 11:11:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578660#M164159</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-08-02T11:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regular Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578662#M164160</link>
      <description>This is a huge domain and I am new to REGEX,&lt;BR /&gt;&lt;BR /&gt;/^VIST\[\w*\]\/\w*V\[\w*]$/&lt;BR /&gt;&lt;BR /&gt;This is the best I could find.&lt;BR /&gt;&lt;BR /&gt;Thank you for all your input.&lt;BR /&gt;&lt;BR /&gt;The website &lt;A href="https://regexr.com/38ed7" target="_blank"&gt;https://regexr.com/38ed7&lt;/A&gt; is very helpful.</description>
      <pubDate>Fri, 02 Aug 2019 11:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regular-Expression/m-p/578662#M164160</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2019-08-02T11:13:34Z</dc:date>
    </item>
  </channel>
</rss>

