<?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 prxchange('s/\W//',-1, string) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827167#M326724</link>
    <description>&lt;P&gt;Hi, a program I inherited has this operation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;prxchange('s/\W//',-1, string)&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;I'm having trouble deciphering the metacharacters, 's/\W//'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I ran the program and compared the strings before and after the operation, there were no differences, so whatever text it's meant to fix doesn't exist in any of the strings. However, I still need to know what it does. I was able to understand part of it using the following links:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002291852.htm" target="_blank" rel="noopener"&gt;Functions and CALL Routines: Using Perl Regular Expressions in the DATA Step - 9.2 (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003288497.htm" target="_blank" rel="noopener"&gt;Perl Regular Expression (PRX) Metacharacters: Tables of Perl Regular Expression (PRX) Metacharacters - 9.2 (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="largeSpace" width="877px" cellspacing="0" cellpadding="5"&gt;
&lt;TBODY&gt;
&lt;TR align="left" valign="top"&gt;
&lt;TD width="248px"&gt;s/&lt;/TD&gt;
&lt;TD width="629px" align="left"&gt;
&lt;P&gt;specifies a substitution regular expression.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD width="248px" align="LEFT" valign="TOP"&gt;\W&lt;/TD&gt;
&lt;TD width="629px" align="LEFT" valign="TOP"&gt;matches any non-word character or nonalphanumeric character, and excludes the underscore.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Are the last two // the pattern for which it's searching? (Though not part of the question, for completeness, the -1 &lt;SPAN&gt;specifies that matching patterns continue to be replaced until the end of the source is reached.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2022 16:49:43 GMT</pubDate>
    <dc:creator>kb011235</dc:creator>
    <dc:date>2022-08-04T16:49:43Z</dc:date>
    <item>
      <title>prxchange('s/\W//',-1, string)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827167#M326724</link>
      <description>&lt;P&gt;Hi, a program I inherited has this operation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;prxchange('s/\W//',-1, string)&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;I'm having trouble deciphering the metacharacters, 's/\W//'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I ran the program and compared the strings before and after the operation, there were no differences, so whatever text it's meant to fix doesn't exist in any of the strings. However, I still need to know what it does. I was able to understand part of it using the following links:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002291852.htm" target="_blank" rel="noopener"&gt;Functions and CALL Routines: Using Perl Regular Expressions in the DATA Step - 9.2 (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003288497.htm" target="_blank" rel="noopener"&gt;Perl Regular Expression (PRX) Metacharacters: Tables of Perl Regular Expression (PRX) Metacharacters - 9.2 (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="largeSpace" width="877px" cellspacing="0" cellpadding="5"&gt;
&lt;TBODY&gt;
&lt;TR align="left" valign="top"&gt;
&lt;TD width="248px"&gt;s/&lt;/TD&gt;
&lt;TD width="629px" align="left"&gt;
&lt;P&gt;specifies a substitution regular expression.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD width="248px" align="LEFT" valign="TOP"&gt;\W&lt;/TD&gt;
&lt;TD width="629px" align="LEFT" valign="TOP"&gt;matches any non-word character or nonalphanumeric character, and excludes the underscore.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Are the last two // the pattern for which it's searching? (Though not part of the question, for completeness, the -1 &lt;SPAN&gt;specifies that matching patterns continue to be replaced until the end of the source is reached.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 16:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827167#M326724</guid>
      <dc:creator>kb011235</dc:creator>
      <dc:date>2022-08-04T16:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: prxchange('s/\W//',-1, string)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827220#M326750</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string $10.;
newString = prxchange('s/\W//',-1, string);
cards;
ABCD1233
ADF343
A?32!
ABC-45
ABC_$%98
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Removes&amp;nbsp;&lt;SPAN&gt;any : non-word character or nonalphanumeric character, and excludes the underscore.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 20:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827220#M326750</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-08-04T20:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: prxchange('s/\W//',-1, string)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827269#M326780</link>
      <description>&lt;P&gt;Your first is incomplete.&amp;nbsp; s/ is just the START of the substitution. The second slash ends the search pattern and the third slash ends the replacement pattern. .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 23:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prxchange-s-W-1-string/m-p/827269#M326780</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-04T23:43:48Z</dc:date>
    </item>
  </channel>
</rss>

