<?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: Perl regular expression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628639#M185796</link>
    <description>&lt;P&gt;A &lt;STRONG&gt;precise regex &lt;/STRONG&gt;would be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;

set have;
if prxmatch("/G(\.|\s)?O(\.|\s)?L/", words);

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;checking for &lt;STRONG&gt;dot&lt;/STRONG&gt; and &lt;STRONG&gt;blank whitespace&lt;/STRONG&gt; char with&lt;STRONG&gt; ? &lt;/STRONG&gt;making the check of the&lt;STRONG&gt; captured buffer&lt;/STRONG&gt; optional&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 02:09:15 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-03-02T02:09:15Z</dc:date>
    <item>
      <title>Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628634#M185791</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any one can help me on Perl regular expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ID:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Words :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$50.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A Googled&lt;/P&gt;
&lt;P&gt;B G.O.L&lt;/P&gt;
&lt;P&gt;C GOL&lt;/P&gt;
&lt;P&gt;D "G O L"&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Check=prxmatch(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/GOL|G.O.L|G O L/"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, words);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result I need is B,C,D but not A by using &lt;FONT face="Courier New" size="3"&gt;prxmatch&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 01:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628634#M185791</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2020-03-02T01:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628635#M185792</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293494"&gt;@Suzy_Cat&lt;/a&gt;&amp;nbsp; You have answered your question. What's the problem? Are you asking to subset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

input ID:$1. Words  $50.;

datalines;
A Googled
B G.O.L
C GOL
D "G O L"
;


run;

data test;

set have;

if prxmatch("/GOL|G.O.L|G O L/", words);

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 01:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628635#M185792</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-02T01:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628636#M185793</link>
      <description>&lt;P&gt;What's the problem?&lt;/P&gt;
&lt;P&gt;Maybe this is simpler?&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;CHECK = prxmatch(&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'/G\W?O\W?L/'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, WORDS);&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 02:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628636#M185793</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-02T02:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628637#M185794</link>
      <description>&lt;P&gt;whoops my bad, accidently put / instead of | between, no wonder it was not working earlier...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Check=prxmatch(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/GOL|G.O.L/G O L/"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, words);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;also there is an extra : when i tested earlier&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ID:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$1.&lt;/FONT&gt;&lt;U&gt;&lt;FONT face="Courier New" size="3"&gt; Words :&lt;/FONT&gt;&lt;/U&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$50.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A Googled&lt;/P&gt;
&lt;P&gt;B G.O.L&lt;/P&gt;
&lt;P&gt;C GOL&lt;/P&gt;
&lt;P&gt;D "G O L"&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 02:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628637#M185794</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2020-03-02T02:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628639#M185796</link>
      <description>&lt;P&gt;A &lt;STRONG&gt;precise regex &lt;/STRONG&gt;would be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;

set have;
if prxmatch("/G(\.|\s)?O(\.|\s)?L/", words);

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;checking for &lt;STRONG&gt;dot&lt;/STRONG&gt; and &lt;STRONG&gt;blank whitespace&lt;/STRONG&gt; char with&lt;STRONG&gt; ? &lt;/STRONG&gt;making the check of the&lt;STRONG&gt; captured buffer&lt;/STRONG&gt; optional&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 02:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628639#M185796</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-02T02:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628640#M185797</link>
      <description>&lt;P&gt;Thank you Chris,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your suggestion is exactly what I was after...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 02:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628640#M185797</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2020-03-02T02:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628643#M185798</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;, That is exactly what i wanted! Thanks heaps for the help out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 02 Mar 2020 02:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628643#M185798</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2020-03-02T02:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628645#M185799</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293494"&gt;@Suzy_Cat&lt;/a&gt;&amp;nbsp; A further spice by not having create &lt;STRONG&gt;capture buffer 2&lt;/STRONG&gt; as we can &lt;EM&gt;&lt;STRONG&gt;back reference&lt;/STRONG&gt;&lt;/EM&gt;. I'm an idiot sometimes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

input ID:$1. Words  $50.;

datalines;
A Googled
B G.O.L
C GOL
D "G O L"
;


run;

data test;

set have;
if prxmatch("/G(\.|\s)?O\1?L/", words);

run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Mar 2020 02:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628645#M185799</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-02T02:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Perl regular expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628648#M185800</link>
      <description>Even better! Noted down the formula for future usage.</description>
      <pubDate>Mon, 02 Mar 2020 02:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Perl-regular-expression/m-p/628648#M185800</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2020-03-02T02:42:19Z</dc:date>
    </item>
  </channel>
</rss>

