<?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 remove characters from a text string using regular expressions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744773#M233367</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying identified all special char present in string expect Keyboard character.&lt;/P&gt;
&lt;P&gt;Below is my program, which is not working for '%$' characters. Please help me how i can ignore&amp;nbsp;'%$' and " as well.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WANT;
STRING="AD'GADJ%$'123@~`";
Identified_Specialcharacters = prxchange('s/[a-z A-Z 0-9 .,?#()-~`!@#^&amp;amp;*_+={}[]|\?&amp;gt;&amp;lt;:;%]//i',-1,STRING);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you in Advance !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 May 2021 15:57:23 GMT</pubDate>
    <dc:creator>singhsahab</dc:creator>
    <dc:date>2021-05-31T15:57:23Z</dc:date>
    <item>
      <title>How to remove characters from a text string using regular expressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744773#M233367</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying identified all special char present in string expect Keyboard character.&lt;/P&gt;
&lt;P&gt;Below is my program, which is not working for '%$' characters. Please help me how i can ignore&amp;nbsp;'%$' and " as well.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WANT;
STRING="AD'GADJ%$'123@~`";
Identified_Specialcharacters = prxchange('s/[a-z A-Z 0-9 .,?#()-~`!@#^&amp;amp;*_+={}[]|\?&amp;gt;&amp;lt;:;%]//i',-1,STRING);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you in Advance !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 15:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744773#M233367</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2021-05-31T15:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744783#M233371</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you need to escape with backslash each of the metacharacters&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;{}[]()^$.|*+?\&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WANT;
   length regEx EscIgnoreChars $200 string $3000;
   STRING='β∞∞π';
   EscIgnoreChars=translate(trim(' { } [ ] ( ) ^ $ . | * + ? \'),'\',' ');
   regEx=cats('s/','[','\w',EscIgnoreChars,',#-~`!@&amp;amp;_=&amp;gt;&amp;lt;:;%',']','//i');
   put regex=;
   Identified_Specialcharacters = cats('&amp;gt;&amp;gt;',prxchange(regEx,-1,STRING),'&amp;lt;&amp;lt;');
   if Identified_Specialcharacters ne '&amp;gt;&amp;gt;&amp;lt;&amp;lt;' then put 'E' 'RROR:' Identified_Specialcharacters=;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure you run SAS with unicode Support to be able to display any of the special chars.&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 14:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744783#M233371</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2021-05-31T14:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744790#M233373</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153275"&gt;@singhsahab&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On an ASCII system you can also specify a range of hexadecimal ASCII codes:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4"&gt;prxchange('s/[&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;\x20-\x7E&lt;/FONT&gt;&lt;/STRONG&gt;]//',-1,STRING)&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;As far as I see, this range consists of all characters you want to remove plus the forward slash (&lt;FONT face="courier new,courier"&gt;'/' = '2F'x&lt;/FONT&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 15:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744790#M233373</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-05-31T15:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove characters from a text string using regular expressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744794#M233375</link>
      <description>Please try and use more descriptive subject lines.</description>
      <pubDate>Mon, 31 May 2021 15:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-characters-from-a-text-string-using-regular/m-p/744794#M233375</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-31T15:58:55Z</dc:date>
    </item>
  </channel>
</rss>

