<?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 regex in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338006#M76844</link>
    <description>&lt;P&gt;&lt;BR /&gt;did the subject complete the entire course of study&lt;BR /&gt;did the subject complete the treatment period&lt;BR /&gt;did subject complete full study protocol&lt;BR /&gt;did subject complete hospital visit&lt;BR /&gt;did subject complete application form&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is a text field with above text. I would like to select only those records which contain the key words "subject" "complete" along with "study" or "treatment" or "protocol".&lt;BR /&gt;the output records are:&lt;BR /&gt;did the subject complete the entire course of study&lt;BR /&gt;did the subject complete the treatment period&lt;BR /&gt;did subject complete full study protocol&lt;/P&gt;&lt;P&gt;any help on regex?&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2017 20:58:57 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2017-03-03T20:58:57Z</dc:date>
    <item>
      <title>SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338005#M76841</link>
      <description>&lt;P&gt;did the subject complete the entire course of study&lt;BR /&gt;did the subject complete the treatment period&lt;BR /&gt;did subject complete full study protocol&lt;BR /&gt;did subject complete hospital visit&lt;BR /&gt;did subject complete application form&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is a text field with above text. I would like to select only those records which contain the key words "subject" "complete" along with "study" or "treatment" or "protocol".&lt;BR /&gt;any help on regex?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 20:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338005#M76841</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2017-03-03T20:43:59Z</dc:date>
    </item>
    <item>
      <title>regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338006#M76844</link>
      <description>&lt;P&gt;&lt;BR /&gt;did the subject complete the entire course of study&lt;BR /&gt;did the subject complete the treatment period&lt;BR /&gt;did subject complete full study protocol&lt;BR /&gt;did subject complete hospital visit&lt;BR /&gt;did subject complete application form&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is a text field with above text. I would like to select only those records which contain the key words "subject" "complete" along with "study" or "treatment" or "protocol".&lt;BR /&gt;the output records are:&lt;BR /&gt;did the subject complete the entire course of study&lt;BR /&gt;did the subject complete the treatment period&lt;BR /&gt;did subject complete full study protocol&lt;/P&gt;&lt;P&gt;any help on regex?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 20:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338006#M76844</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2017-03-03T20:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338008#M76843</link>
      <description>&lt;P&gt;PLEASE edit your posts, don't post duplicates.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 21:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338008#M76843</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-03T21:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338025#M76849</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data f;
length str $ 64;
array x[2] $  8 _temporary_ ('subject' 'complete');
array y[3] $  9 _temporary_ ('study' 'treatment' 'protocol');
input str &amp;amp;;
j=0;
do i=1 to dim(x);
  j+findw(str,x[i],,'tsmi')&amp;gt;0;
end;
if j=dim(x) and prxmatch('/\b('||catx('|',of y[*])||')\b/i',str)&amp;gt;0;
cards;
did the subject complete the entire course of study
did the subject complete the treatment period
did subject complete full study protocol
did subject complete hospital visit
did subject complete application form
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2017 22:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338025#M76849</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-03-03T22:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338029#M76850</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The final output should contain only these three records as I'm looking for combination of subject complete along with either study,treatment or protocol&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token data string"&gt;did the subject complete the entire course of study
did the subject complete the treatment period
did subject complete full study protocol&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 21:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338029#M76850</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2017-03-03T21:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338044#M76853</link>
      <description>&lt;P&gt;Matt's (&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19924"&gt;@FriedEgg&lt;/a&gt;) code did that, but showed the results in the log rather than the file. A minor change to his code puts the results in a file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
  length str $ 64;
  array x[2] $  8 _temporary_ ('subject' 'complete');
  array y[3] $  9 _temporary_ ('study' 'treatment' 'protocol');
  input str &amp;amp;;
  j=0;
  do i=1 to dim(x);
    j+findw(str,x[i],,'tsmi')&amp;gt;0;
  end;
  if j=dim(x) and prxmatch('/('||catx('|',of y[*])||')/i',str)&amp;gt;0;
  cards;
did the subject complete the entire course of study
did the subject complete the treatment period
did subject complete full study protocol
did subject complete hospital visit
did subject complete application form
;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 22:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338044#M76853</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-03T22:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338058#M76860</link>
      <description>Updated my post</description>
      <pubDate>Fri, 03 Mar 2017 22:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338058#M76860</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-03-03T22:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338059#M76861</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data in;
length str $64;
input str &amp;amp;;
cards;
did the subject complete the entire course of study
did the subject complete the treatment period
did subject complete full study protocol
did subject complete hospital visit
did subject complete application form
;
run;

data out;
	set in;
	if prxmatch("/\bsubject\b.*\bcomplete\b.*(\bstudy\b|\btreatment\b|\bprotocol\b)/",str)&lt;BR /&gt; then output;
run;&lt;/PRE&gt;
&lt;P&gt;The \b characters force the regex to match only on word boundaries and \b.* means their can&amp;nbsp;be multiple words between the matching ones.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 22:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338059#M76861</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-03-03T22:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338061#M76862</link>
      <description>it can be a bit simplified:&lt;BR /&gt;&lt;BR /&gt;/\bsubject\b.*\bcomplete\b.*\b(study|treatment|protocol)\b/i&lt;BR /&gt;&lt;BR /&gt;the reason I chose not to do this was to avoid the assumed logic that the words would always be in this order.</description>
      <pubDate>Fri, 03 Mar 2017 22:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338061#M76862</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-03-03T22:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338075#M76868</link>
      <description>&lt;P&gt;That's a good point about word order - you could probably do something with capture groups if they could appear in any order.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 00:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338075#M76868</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-03-04T00:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338533#M77109</link>
      <description>&lt;P&gt;Thanks! and any words we dont want, can be separated out like [^do not include] , right?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 18:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338533#M77109</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2017-03-06T18:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338535#M77110</link>
      <description>[^] creates a negated set, it is specific to the characters within the set, no strings.</description>
      <pubDate>Mon, 06 Mar 2017 19:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338535#M77110</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-03-06T19:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS regex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338552#M77118</link>
      <description>&lt;P&gt;to exlcude the list then itset prxmatch(list1|list2!..columnname)=0 must work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 19:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-regex/m-p/338552#M77118</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2017-03-06T19:53:13Z</dc:date>
    </item>
  </channel>
</rss>

