<?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 how to modify PERL Regular Expression in my sample code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/617667#M181035</link>
    <description>&lt;P&gt;Hi guys, could you help&amp;nbsp;&amp;nbsp;to modify code since I'm not familar with PRX.&lt;/P&gt;&lt;P&gt;I want to extract the&amp;nbsp;words including lower case letters, upper case letters and digits,(a-z,A-Z,0-9), and the length word is 8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\w&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data a;
	length string $200;
	string='Befor??e Bexfore1 Beforexx  xxxxxxxx  nightmare  or On the End,..ed 1234(678 of abc abc12345  1234567_   1 high';
run;

data a1;
 	length s1 $8 ;
	set a;
	do i=1 to countw(string,' ');
	  temp=scan(string,i,' ');
	  if prxmatch("/\w{8}?/",temp) and not index(temp,"_")  then do;
		 s1=temp;
		 output;
	  end;
	end;
run;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="a.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35377i6CBDECBE441F8321/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a.JPG" alt="a.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;how to modify the PRX to delete the word "nightmare" whose length is over 8? offer more than one method of PRX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2020 04:12:13 GMT</pubDate>
    <dc:creator>blueskyxyz</dc:creator>
    <dc:date>2020-01-16T04:12:13Z</dc:date>
    <item>
      <title>how to modify PERL Regular Expression in my sample code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/617667#M181035</link>
      <description>&lt;P&gt;Hi guys, could you help&amp;nbsp;&amp;nbsp;to modify code since I'm not familar with PRX.&lt;/P&gt;&lt;P&gt;I want to extract the&amp;nbsp;words including lower case letters, upper case letters and digits,(a-z,A-Z,0-9), and the length word is 8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\w&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data a;
	length string $200;
	string='Befor??e Bexfore1 Beforexx  xxxxxxxx  nightmare  or On the End,..ed 1234(678 of abc abc12345  1234567_   1 high';
run;

data a1;
 	length s1 $8 ;
	set a;
	do i=1 to countw(string,' ');
	  temp=scan(string,i,' ');
	  if prxmatch("/\w{8}?/",temp) and not index(temp,"_")  then do;
		 s1=temp;
		 output;
	  end;
	end;
run;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="a.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35377i6CBDECBE441F8321/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a.JPG" alt="a.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;how to modify the PRX to delete the word "nightmare" whose length is over 8? offer more than one method of PRX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 04:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/617667#M181035</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-01-16T04:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to modify PERL Regular Expression in my sample code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/617671#M181036</link>
      <description>&lt;P&gt;prxNext routine allows you to scan a string efficiently. Instead of using \w to mean a word character (including an underscore) and then testing for the presence of an underscore, be explicit and specify [a-zA-Z0-9]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a1;
prxId = prxparse("/\b[a-zA-Z0-9]{8}\b/o");
set a;
start = 1; stop = -1;
call prxnext(prxID, start, stop, string, position, length);
  do while (position &amp;gt; 0);
     found = substr(string, position, length);
     output;
     call prxnext(prxID, start, stop, string, position, length);
  end;
keep string found;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jan 2020 04:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/617671#M181036</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-01-16T04:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to modify PERL Regular Expression in my sample code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/618004#M181218</link>
      <description>&lt;P&gt;hi PG, thank you very much,&amp;nbsp;&amp;nbsp;\b match word&amp;nbsp;boundary&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 05:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-modify-PERL-Regular-Expression-in-my-sample-code/m-p/618004#M181218</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2020-01-17T05:37:06Z</dc:date>
    </item>
  </channel>
</rss>

