<?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: Spaces in prxmatch function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954762#M372869</link>
    <description>&lt;P&gt;Bonjour&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
input lb_c $20.;
crit1=prxmatch("/T6/",lb_c) &lt;STRONG&gt;and&lt;/STRONG&gt; prxmatch("/T 6/",lb_c);
crit2=prxmatch("/T6/",lb_c) &lt;STRONG&gt;or&lt;/STRONG&gt;  prxmatch("/T 6/",lb_c);
label crit1='Contains both "T6" and "T 6"'
      crit2='Contains "T6" or "T&amp;nbsp;6" (or&amp;nbsp;both)';
cards;
......
...T6...
...T 6...
...T 6...T6...
...T6...T 6...
;

proc print data=test label;
run;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;                                       Contains
                          Contains     "T6" or
                         both "T6"      "T&amp;nbsp;6"
Obs    lb_c              and "T 6"    (or&amp;nbsp;both)

 1     ......                0            0
 2     ...T6...              0            1
 3     ...T 6...             0            1
 4     ...T 6...T6...        1            1
 5     ...T6...T 6...        1            1
&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Dec 2024 12:01:56 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-12-30T12:01:56Z</dc:date>
    <item>
      <title>Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954755#M372866</link>
      <description>&lt;P&gt;Bonjour les experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Savez-vous, s’il vous plaît, comment marquer les espaces à l’intérieur de la fonction prxmatch :&lt;/P&gt;
&lt;P&gt;Je souhaite avoir les données avec T6 et T 6 :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (prxmatch("/T6/",lb_c)&amp;gt;0 and (prxmatch("/T 6/",lb_c)&amp;gt;0&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Merci !&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 11:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954755#M372866</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-12-30T11:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954762#M372869</link>
      <description>&lt;P&gt;Bonjour&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
input lb_c $20.;
crit1=prxmatch("/T6/",lb_c) &lt;STRONG&gt;and&lt;/STRONG&gt; prxmatch("/T 6/",lb_c);
crit2=prxmatch("/T6/",lb_c) &lt;STRONG&gt;or&lt;/STRONG&gt;  prxmatch("/T 6/",lb_c);
label crit1='Contains both "T6" and "T 6"'
      crit2='Contains "T6" or "T&amp;nbsp;6" (or&amp;nbsp;both)';
cards;
......
...T6...
...T 6...
...T 6...T6...
...T6...T 6...
;

proc print data=test label;
run;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;                                       Contains
                          Contains     "T6" or
                         both "T6"      "T&amp;nbsp;6"
Obs    lb_c              and "T 6"    (or&amp;nbsp;both)

 1     ......                0            0
 2     ...T6...              0            1
 3     ...T 6...             0            1
 4     ...T 6...T6...        1            1
 5     ...T6...T 6...        1            1
&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Dec 2024 12:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954762#M372869</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-12-30T12:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954763#M372870</link>
      <description>&lt;P&gt;More people could help you if you ask your question in English, provide some test data in usable form and results of your experiments up to now...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input lb_c $ 64.;
cards;
T6          /* yes */
T 6         /* yes */
ABC T6 DEF  /* yes */
abc T 6 def /* yes */
abc TX6 efg /* no */
abcT6efg    /* ??? */
abcT 6efg   /* ??? */
;
run;
proc print;
run;

data want;
set have;
flag = prxmatch("/T6|T\ 6/",lb_c)&amp;gt;0;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;EDIT:&lt;/P&gt;
&lt;P&gt;Alternative form:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;flag = prxmatch("/(T( )?6)/",lb_c)&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 12:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954763#M372870</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-12-30T12:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954797#M372882</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Utilisez le mot-clé \s pour supprimer les espaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if prxmatch("/T\s*6/",lb_c)&amp;gt;0 &lt;/PRE&gt;
&lt;P&gt;Here * means zero space or at least one space.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 01:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954797#M372882</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-31T01:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954801#M372886</link>
      <description>My apologies, I wrote in English, the site translate directly in French, I don't know why.</description>
      <pubDate>Tue, 31 Dec 2024 07:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954801#M372886</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-12-31T07:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954802#M372887</link>
      <description>Thank you very much, Ksharp!</description>
      <pubDate>Tue, 31 Dec 2024 08:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954802#M372887</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-12-31T08:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954803#M372888</link>
      <description>&lt;P&gt;No worries, we figured the problem out and that's the most important! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 09:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954803#M372888</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-12-31T09:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954804#M372889</link>
      <description>&lt;P&gt;The "\s*" will give us "T6" (zero spaces), and "T 6"(one space), but also "T&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6" (thousands spaces). Wasn't to OP about 0 or 1 space? Or did I misunderstand it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 09:11:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954804#M372889</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-12-31T09:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces in prxmatch function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954805#M372890</link>
      <description>If it was about 0 or 1 space. Could try this(use ? replace with *):&lt;BR /&gt;&lt;BR /&gt;if prxmatch("/T\s?6/",lb_c)&amp;gt;0</description>
      <pubDate>Tue, 31 Dec 2024 09:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-in-prxmatch-function/m-p/954805#M372890</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-31T09:53:24Z</dc:date>
    </item>
  </channel>
</rss>

