<?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: Prxchange with more than 1 condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918463#M361793</link>
    <description>Thanks for your help it works perfectly!</description>
    <pubDate>Thu, 29 Feb 2024 18:46:21 GMT</pubDate>
    <dc:creator>Feyng819</dc:creator>
    <dc:date>2024-02-29T18:46:21Z</dc:date>
    <item>
      <title>Prxchange with more than 1 condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918253#M361710</link>
      <description>Let’s say I wanna use prxchange to replace the string that starts with “The” or contain the word “world”. How can I use prxchange to achieve the multiple condition?&lt;BR /&gt;&lt;BR /&gt;I only know that to replace the string starts with “the” would be prxchange(“s/\b^(The)\b/ /,-1,variable)&lt;BR /&gt;And to replace the string contains “world” would be prxchange(“s/\b(world)\b/ /,-1,variable)&lt;BR /&gt;Is there a way to combine the 2? Thanks!</description>
      <pubDate>Wed, 28 Feb 2024 16:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918253#M361710</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-02-28T16:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Prxchange with more than 1 condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918295#M361725</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389348"&gt;@Feyng819&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The simplest way to combine the two replacements would be to apply the second PRXCHANGE function call to the result of the first, i.e., replace "&lt;FONT face="courier new,courier"&gt;variable&lt;/FONT&gt;" in the second call with the entire &lt;FONT face="courier new,courier"&gt;prxchange(&lt;/FONT&gt;...&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt; expression of the first. In this particular case, however, it is also possible to use the OR operator (|) like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;prxchange('s/^The\b|\bworld\b//',-1,variable);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This would remove the word "The" from the beginning of the string in &lt;FONT face="courier new,courier"&gt;variable&lt;/FONT&gt; as well as all occurrences of the word "world". (Note the case-sensitivity without the "&lt;FONT face="courier new,courier"&gt;i&lt;/FONT&gt;" modifier at the end of the regular expression.)&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 19:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918295#M361725</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-28T19:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Prxchange with more than 1 condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918463#M361793</link>
      <description>Thanks for your help it works perfectly!</description>
      <pubDate>Thu, 29 Feb 2024 18:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxchange-with-more-than-1-condition/m-p/918463#M361793</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-02-29T18:46:21Z</dc:date>
    </item>
  </channel>
</rss>

