<?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 Extract string with specific format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800156#M314723</link>
    <description>&lt;P&gt;&lt;U&gt;Hi&lt;/U&gt; everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to extract all the strings with a specific format for example "ABCxxx_x".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 'x' symbol refers to digit numbers (from 0 to 9).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I want to get the string "ABC123_3" or "ABC598_4".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 14:33:57 GMT</pubDate>
    <dc:creator>Chrisas</dc:creator>
    <dc:date>2022-03-04T14:33:57Z</dc:date>
    <item>
      <title>Extract string with specific format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800156#M314723</link>
      <description>&lt;P&gt;&lt;U&gt;Hi&lt;/U&gt; everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to extract all the strings with a specific format for example "ABCxxx_x".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 'x' symbol refers to digit numbers (from 0 to 9).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I want to get the string "ABC123_3" or "ABC598_4".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 14:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800156#M314723</guid>
      <dc:creator>Chrisas</dc:creator>
      <dc:date>2022-03-04T14:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string with specific format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800158#M314724</link>
      <description>&lt;P&gt;So you want all strings that begin with "ABC"? Or all strings that begin with any three letters followed by numbers and/or symbols? Or can strings that begin with 2 characters or 4 characters also be acceptable?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't make us generalize from a single example, that is impossible.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please explain exactly what you are looking for. Give examples of what you want and what you don't want.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 14:10:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800158#M314724</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-04T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string with specific format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800161#M314727</link>
      <description>&lt;P&gt;We need to know how the strings look it and what you expect as result., so please provide data in usable form and show what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 14:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800161#M314727</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-03-04T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string with specific format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800163#M314729</link>
      <description>&lt;P&gt;Here's an example using &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0bj9p4401w3n9n1gmv6tf**bleep**9m.htm#p1vrrbbga42an4n1h7gn2buiui6z" target="_self"&gt;PRXMATCH&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;I made some assumptions, but the example should help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
	infile cards ;
	input myText :$12. ;

cards;
ABC123_4
DEF567_8
not_me
or_me
or_123
;

data want ;
	retain patternID;
	if _n_=1 then do ;
      pattern="/[A-Z]{3}[0-9]{3}_[0-9]/";
      patternID=prxparse(pattern);		
	end ;
	set have ;
	position=prxmatch(patternID, myText);
	put mytext= @25 position= ;
run ;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Mar 2022 14:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/800163#M314729</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-03-04T14:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string with specific format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/801376#M315385</link>
      <description>Thank you for your response. I want the first three letters to begin with "ABC" then the next three characters to be digit number from 0-9, then underscore and then one digit number from 0-9.&lt;BR /&gt;&lt;BR /&gt;For example: I want ABC123_3 or ABC564_9.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Mar 2022 16:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/801376#M315385</guid>
      <dc:creator>Chrisas</dc:creator>
      <dc:date>2022-03-10T16:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string with specific format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/801378#M315386</link>
      <description>&lt;P&gt;So you only need to adapt the pattern given by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226241"&gt;@AMSAS&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pattern="/ABC[0-9]{3}_[0-9]/";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 16:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-string-with-specific-format/m-p/801378#M315386</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-10T16:11:48Z</dc:date>
    </item>
  </channel>
</rss>

