<?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: regular expressions (with PERL) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103688#M29020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;\w does not find spaces.&amp;nbsp; This seems to work but I'm no RegXpert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; temp2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; note_text &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; re= prxparse(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: 'Courier New';"&gt;'/lung\w{0,15}|\s{1,5}clear/'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; prxmatch(re,note_text) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; ch=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; re;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungs are clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungs&amp;nbsp;&amp;nbsp;&amp;nbsp; clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungsclear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungs appear clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jul 2012 15:53:12 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2012-07-10T15:53:12Z</dc:date>
    <item>
      <title>regular expressions (with PERL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103687#M29019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK all-&lt;/P&gt;&lt;P&gt;So I am trying to figure out regular expressions and I am having a little bit of a challenge.&lt;/P&gt;&lt;P&gt;I am text mining a note field (that can have thousands of characters)-below is just one parameter that I am looking for-&lt;/P&gt;&lt;P&gt;I am looking for it to return a (or any)&amp;nbsp; value-but it just returns blanks-&lt;/P&gt;&lt;P&gt;Essentially I am looking for certain key phrases-&lt;/P&gt;&lt;P&gt;such as:&lt;/P&gt;&lt;P&gt;lungs are clear&lt;/P&gt;&lt;P&gt;lungs clear&lt;/P&gt;&lt;P&gt;lungs appear clear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help-&lt;/P&gt;&lt;P&gt;Lawrence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp2;&lt;/P&gt;&lt;P&gt;set notes;&lt;/P&gt;&lt;P&gt;if _n_=1 then do;&lt;/P&gt;&lt;P&gt;re= prxparse('/lung\w{0,15}clear/');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if prxmatch(re,note_text) then ch=1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;retain re;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 14:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103687#M29019</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2012-07-10T14:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions (with PERL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103688#M29020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;\w does not find spaces.&amp;nbsp; This seems to work but I'm no RegXpert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; temp2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; note_text &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; re= prxparse(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: 'Courier New';"&gt;'/lung\w{0,15}|\s{1,5}clear/'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; prxmatch(re,note_text) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; ch=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; re;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungs are clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungs&amp;nbsp;&amp;nbsp;&amp;nbsp; clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungsclear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;lungs appear clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 15:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103688#M29020</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-07-10T15:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions (with PERL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103689#M29021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that the \w metacharacter won't include whitespace, such as blank or tab. Try a period (.) instead, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/lung.{0,15}clear/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, move your prxmatch function after your end;&lt;/P&gt;&lt;P&gt;Right now, you're only checking the first record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe that your pattern will find "lungclear", which you might not want. If not, change it to {1,15}.&lt;/P&gt;&lt;P&gt;You're absolutely on the right track; you'll have it soon!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 15:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103689#M29021</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2012-07-10T15:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions (with PERL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103690#M29022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks both of you!&lt;/P&gt;&lt;P&gt;Both solutions help although TomKari's answer works a tiny bit better.&lt;/P&gt;&lt;P&gt;Another question for you TomKari-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I set the first letter of lung to be either upper or lowercase?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lawrence &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 16:37:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/regular-expressions-with-PERL/m-p/103690#M29022</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2012-07-10T16:37:49Z</dc:date>
    </item>
  </channel>
</rss>

