<?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 regulare expression; detecte the special charatere '(' in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528793#M144358</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to extract whith regulars expressions the parts of names that are surrounded by paratheses.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For started, I try to detect what starts with a parenthesis and no word does match.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is why, i am asking you for help me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input name $25.;
  cards;
test (ex)
(ex) test
test test
;
run;


data test1;
set test;
i=1;
do while (scan(name,i, " ") ne ' ') ;
    part=scan(name,i);
    regex = prxparse("/(?&amp;lt;=\()/");
    if prxmatch(regex, part) &amp;gt;0 then output;
    i+1;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Jan 2019 15:54:05 GMT</pubDate>
    <dc:creator>mansour_ib_sas</dc:creator>
    <dc:date>2019-01-21T15:54:05Z</dc:date>
    <item>
      <title>regulare expression; detecte the special charatere '('</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528793#M144358</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to extract whith regulars expressions the parts of names that are surrounded by paratheses.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For started, I try to detect what starts with a parenthesis and no word does match.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is why, i am asking you for help me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input name $25.;
  cards;
test (ex)
(ex) test
test test
;
run;


data test1;
set test;
i=1;
do while (scan(name,i, " ") ne ' ') ;
    part=scan(name,i);
    regex = prxparse("/(?&amp;lt;=\()/");
    if prxmatch(regex, part) &amp;gt;0 then output;
    i+1;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 15:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528793#M144358</guid>
      <dc:creator>mansour_ib_sas</dc:creator>
      <dc:date>2019-01-21T15:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: regulare expression; detecte the special charatere '('</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528805#M144362</link>
      <description>&lt;P&gt;So for each value of the &lt;STRONG&gt;name&lt;/STRONG&gt; variable that is inside a parenthesis, you want a new record, correct?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your posted data set, what does your desired result look like?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 16:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528805#M144362</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-21T16:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: regulare expression; detecte the special charatere '('</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528825#M144368</link>
      <description>&lt;P&gt;Thank you for your answer,&lt;/P&gt;&lt;P&gt;For your first question, i want to delete the reccord&amp;nbsp;&lt;SPAN&gt;inside a parenthesis&amp;nbsp; by regulare expression&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;For your second question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; test&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; name &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;25&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;  &lt;SPAN class="token keyword"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;&lt;BR /&gt;test
test
test test&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 17:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528825#M144368</guid>
      <dc:creator>mansour_ib_sas</dc:creator>
      <dc:date>2019-01-21T17:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: regulare expression; detecte the special charatere '('</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528842#M144380</link>
      <description>&lt;P&gt;Ok. You can do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input name $25.;
  cards;
test (ex)
(ex) test
test test
;
run;

data want;
   set test;
   a=prxchange('s/\(.*\)//', -1, name);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 18:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528842#M144380</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-21T18:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: regulare expression; detecte the special charatere '('</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528877#M144406</link>
      <description>&lt;P&gt;Or rather,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input name $25.;
  cards;
test (ex)
(ex) test
(ex) test (ex)
test test
;

data want;
   set test;
   new_name = prxchange('s/\s*\(.*?\)\s*//', -1, name);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 20:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/528877#M144406</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-01-21T20:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: regulare expression; detecte the special charatere '('</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/529002#M144465</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To the method I'm trying to applay, I&amp;nbsp;understood where the problem came.&lt;/P&gt;&lt;P&gt;At the scan, I forgot&amp;nbsp; to add space as a separator.&lt;/P&gt;&lt;P&gt;Now, I can separate the string charcters correctly.&lt;/P&gt;&lt;P&gt;Thank you for you help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1;
set test;
i=1;
do while (scan(name,i, " ") ne ' ') ;
    part=scan(name,i,'');
    regex = prxparse('/\(/');
    if prxmatch(regex, part) &amp;gt;0 then output;
    i+1;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 09:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regulare-expression-detecte-the-special-charatere/m-p/529002#M144465</guid>
      <dc:creator>mansour_ib_sas</dc:creator>
      <dc:date>2019-01-22T09:22:57Z</dc:date>
    </item>
  </channel>
</rss>

