<?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: How to use a variable of a dataset as perl-regular-expression in PRXMATCH within datastep in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539471#M148643</link>
    <description>Yes. Thank you!!</description>
    <pubDate>Thu, 28 Feb 2019 20:12:41 GMT</pubDate>
    <dc:creator>Ramesh_165</dc:creator>
    <dc:date>2019-02-28T20:12:41Z</dc:date>
    <item>
      <title>How to use a variable of a dataset as perl-regular-expression in PRXMATCH within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539469#M148641</link>
      <description>&lt;P&gt;I need to use one the data variables in a dataset as Perl-regular-expression in PRXMATCH. Could someone help me with that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able to do this with Index function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	set sashelp.cars(obs=10);
	type1 = strip(type) || '1';
	type_check = index(strip(type1), strip(type));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If this needs to be converted to use PRXMATCH function, what would the&amp;nbsp;Perl-regular-expression be?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	set sashelp.cars(obs=10);
	type1 = strip(type) || '1';
	type_check_regex = prxmatch(????,strip(type1));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The Perl-regular-expression has to be dynamic for each observation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ramesh&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 20:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539469#M148641</guid>
      <dc:creator>Ramesh_165</dc:creator>
      <dc:date>2019-02-28T20:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable of a dataset as perl-regular-expression in PRXMATCH within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539470#M148642</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;prxmatch(cats("/",type,"/i"), type1)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as long as &lt;STRONG&gt;type&lt;/STRONG&gt; doesn't include perl special characters.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 20:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539470#M148642</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-02-28T20:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable of a dataset as perl-regular-expression in PRXMATCH within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539471#M148643</link>
      <description>Yes. Thank you!!</description>
      <pubDate>Thu, 28 Feb 2019 20:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-a-variable-of-a-dataset-as-perl-regular-expression-in/m-p/539471#M148643</guid>
      <dc:creator>Ramesh_165</dc:creator>
      <dc:date>2019-02-28T20:12:41Z</dc:date>
    </item>
  </channel>
</rss>

