<?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: perl expression to change not in group of value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408923#M279484</link>
    <description>&lt;P&gt;^ can only be used in a [] class.&lt;/P&gt;
&lt;P&gt;But this works too if you want another way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
  a='ELISG_ST#AT_#S_STD#D="Y"';
  b=prxchange('s/.*?((ST)|(LI))?.*?/$1/',-1,a);
  put a= / b=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;b=LISTST&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2017 22:19:26 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-10-30T22:19:26Z</dc:date>
    <item>
      <title>perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408550#M279478</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to change every character that not ST or LI to " "&lt;/P&gt;&lt;P&gt;I wrote this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
a='ELISG_ST#AT_#S_STD#D="Y"';
b=prxchange('s/[^(ST|LI)]/ /',-1,a);
put a=;
put b=;
run;&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;a=ELISG_ST#AT_#S_STD#D="Y"&lt;/P&gt;&lt;P&gt;this is the output:&lt;BR /&gt;b=LIS ST T S ST&lt;/P&gt;&lt;P&gt;this is the desire output:&lt;/P&gt;&lt;P&gt;LI ST ST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I use not without this [] brackets that create class group?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 10:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408550#M279478</guid>
      <dc:creator>Ditza1</dc:creator>
      <dc:date>2017-10-30T10:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408628#M279479</link>
      <description>&lt;PRE&gt;

data _null_;
a='ELISG_ST#AT_#S_STD#D="Y"';
length b $ 100;
do i=1 to length(a)-1;
 temp=substr(a,i,2);
 if temp  in ('ST' 'LI') then b=catx(' ',b,temp);
end;
put a=;
put b=;
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408628#M279479</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-30T12:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408632#M279480</link>
      <description>Hi,&lt;BR /&gt;Thanks for the answer, but I am looking for a way to do it with regular&lt;BR /&gt;expressions&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408632#M279480</guid>
      <dc:creator>Ditza1</dc:creator>
      <dc:date>2017-10-30T12:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408643#M279481</link>
      <description>&lt;PRE&gt;
OK. No problem.


data _null_;
a='ELISG_ST#AT_#S_STD#D="Y"';


length b $ 200;
start=1;
end=length(a);
pid=prxparse('/ST|LI/');
call prxnext(pid,start,end,a,p,l);
do while(p&amp;gt;0);
 b=catx(' ',b,substr(a,p,l));
 output;
 call prxnext(pid,start,end,a,p,l);
end;

put a=;
put b=;
run;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2017 13:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408643#M279481</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-30T13:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408650#M279482</link>
      <description>&lt;PRE&gt;
Opps.
Delete the OUTPUT statement.


&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2017 13:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408650#M279482</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-30T13:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408826#M279483</link>
      <description>&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing this as part of learn regular expression, so I am not looking&amp;nbsp;for a solution to this specific problem.&lt;/P&gt;&lt;P&gt;I try to understand how to do it only with regular expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I want to change ST and LI&lt;/P&gt;&lt;P&gt;I will use the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
a='ELISG_ST#AT_#S_STD#D="Y"';
b=prxchange('s/(ST|LI)/ /',-1,a);
put a=;
put b=;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am looking for a way to put not on (ST|LI)&amp;nbsp;&lt;/P&gt;&lt;P&gt;any Ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 18:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408826#M279483</guid>
      <dc:creator>Ditza1</dc:creator>
      <dc:date>2017-10-30T18:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: perl expression to change not in group of value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408923#M279484</link>
      <description>&lt;P&gt;^ can only be used in a [] class.&lt;/P&gt;
&lt;P&gt;But this works too if you want another way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
  a='ELISG_ST#AT_#S_STD#D="Y"';
  b=prxchange('s/.*?((ST)|(LI))?.*?/$1/',-1,a);
  put a= / b=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;b=LISTST&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 22:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/perl-expression-to-change-not-in-group-of-value/m-p/408923#M279484</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-30T22:19:26Z</dc:date>
    </item>
  </channel>
</rss>

