<?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 from R to SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/regex-from-R-to-SAS/m-p/245170#M45716</link>
    <description>&lt;P&gt;I think it matches any string that contains an "a". &amp;nbsp;At least that's what my limited testing shows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4043  data _null_;
4044     input line $20.;
4045     if _n_ eq 1 then rx=prxparse("/.*a.*/");
4046     retain rx;
4047     match = prxmatch(rx,strip(line));
4048     put (_all_)(=);
4049     cards;

line=hello rx=1 match=0
line=helloah rx=1 match=1
line=zzz rx=1 match=0
line=  rx=1 match=0
line=ahhello rx=1 match=1
line=678ab rx=1 match=1
line=a rx=1 match=1
line=ta rx=1 match=1
line=u rx=1 match=0&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Jan 2016 13:30:16 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2016-01-21T13:30:16Z</dc:date>
    <item>
      <title>regex from R to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regex-from-R-to-SAS/m-p/244919#M45687</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to migrate some old R code to sas and found the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datarow$varibale[grep(".*a.*",datarow$Original),] &amp;lt;- "new column"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont quite get what its doing, guessing it takes everything that starts with .a and put it in a new varialbe Iwonder if someone can help me translating it into sas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 10:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regex-from-R-to-SAS/m-p/244919#M45687</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-01-21T10:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: regex from R to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regex-from-R-to-SAS/m-p/245170#M45716</link>
      <description>&lt;P&gt;I think it matches any string that contains an "a". &amp;nbsp;At least that's what my limited testing shows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4043  data _null_;
4044     input line $20.;
4045     if _n_ eq 1 then rx=prxparse("/.*a.*/");
4046     retain rx;
4047     match = prxmatch(rx,strip(line));
4048     put (_all_)(=);
4049     cards;

line=hello rx=1 match=0
line=helloah rx=1 match=1
line=zzz rx=1 match=0
line=  rx=1 match=0
line=ahhello rx=1 match=1
line=678ab rx=1 match=1
line=a rx=1 match=1
line=ta rx=1 match=1
line=u rx=1 match=0&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2016 13:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regex-from-R-to-SAS/m-p/245170#M45716</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-01-21T13:30:16Z</dc:date>
    </item>
  </channel>
</rss>

