<?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: Prxmatch function for multiple values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961329#M374776</link>
    <description>&lt;P&gt;In regular expressions period has special meaning, it will match any single character.&amp;nbsp; If you want to match an actual period you need to code \. in the regular expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to match any of a series of characters include them in a set of square brackets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input string $char40.;
  loc = prxmatch('/\b1[,\.]50%|\b1[,\.]75%/',string);
cards;
1.50%
1,50%
1.75%
1,75%
1.5%
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-08 at 2.36.26 PM.png" style="width: 218px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105295i5EE17BD1D04E6E56/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-08 at 2.36.26 PM.png" alt="Screenshot 2025-03-08 at 2.36.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Mar 2025 19:37:02 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-03-08T19:37:02Z</dc:date>
    <item>
      <title>Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961322#M374774</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find 1,50% in the data string I apply the function prxmatch("/\b1,50%|\b1.750%/",line)&amp;gt;0.&lt;/P&gt;
&lt;P&gt;I get a correct result for 1,50% but when I have 1.50% this function doesn't work (can't find the 1.50%). I don't know if my code is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2025 17:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961322#M374774</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2025-03-08T17:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961329#M374776</link>
      <description>&lt;P&gt;In regular expressions period has special meaning, it will match any single character.&amp;nbsp; If you want to match an actual period you need to code \. in the regular expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to match any of a series of characters include them in a set of square brackets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input string $char40.;
  loc = prxmatch('/\b1[,\.]50%|\b1[,\.]75%/',string);
cards;
1.50%
1,50%
1.75%
1,75%
1.5%
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-08 at 2.36.26 PM.png" style="width: 218px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105295i5EE17BD1D04E6E56/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-08 at 2.36.26 PM.png" alt="Screenshot 2025-03-08 at 2.36.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2025 19:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961329#M374776</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-08T19:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961334#M374780</link>
      <description>Thank you, Tom!&lt;BR /&gt;As I understand, if I write prxmatch("/\b1.50%/",line)&amp;gt;0 the function is looking for 1 or 50?</description>
      <pubDate>Sat, 08 Mar 2025 23:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961334#M374780</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2025-03-08T23:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961338#M374782</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you, Tom!&lt;BR /&gt;As I understand, if I write prxmatch("/\b1.50%/",line)&amp;gt;0 the function is looking for 1 or 50?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No.&amp;nbsp; It will be look for things like:&lt;/P&gt;
&lt;PRE&gt;1.50%
1,50%
1A50%
1x50%&lt;/PRE&gt;
&lt;P&gt;If you want to look for 1 or 50 you would use | just like your original post used | so it could search for 1,50% or 1.750%&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code that would make words that consist of only 1 or 50.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; prxmatch('/\b(1|50)\b/',line)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Mar 2025 03:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961338#M374782</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-09T03:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961347#M374785</link>
      <description>Thank you, Tom.&lt;BR /&gt; I not understand the first explication "In regular expressions period has special meaning, it will match any single character. "</description>
      <pubDate>Sun, 09 Mar 2025 09:39:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961347#M374785</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2025-03-09T09:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961349#M374787</link>
      <description>Thank you ! If I need to get 1.50 or 1.50 % or 1.50% can I write  prxmatch("/\b1[,\.]50\s*%/",line)&amp;gt;0 ?&lt;BR /&gt;s*% is right ?</description>
      <pubDate>Sun, 09 Mar 2025 11:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961349#M374787</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2025-03-09T11:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Prxmatch function for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961353#M374789</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you ! If I need to get 1.50 or 1.50 % or 1.50% can I write prxmatch("/\b1[,\.]50\s*%/",line)&amp;gt;0 ?&lt;BR /&gt;s*% is right ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Looks reasonable.&amp;nbsp; Try it out.&amp;nbsp; I posted a simple example data step before. So use something like that to quickly test it on a lot of different strings.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Mar 2025 18:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prxmatch-function-for-multiple-values/m-p/961353#M374789</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-09T18:16:57Z</dc:date>
    </item>
  </channel>
</rss>

