<?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 identify consecutively repeating characters in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215400#M53014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could learn it with "Googling" and "try and error" - so you can too!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need to learn Perl for RegEx - Perl just implemented a syntax for Regular Expression which became a quasi standard. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Apr 2015 09:40:48 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2015-04-03T09:40:48Z</dc:date>
    <item>
      <title>How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215391#M53005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code is giving me false positive.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have character data that has ID Numbers.&amp;nbsp; It is 9 character long string and has numbers as char data from 0 to 9.&amp;nbsp; I am trying to identify if 5 or more consecutive characters are the same.&amp;nbsp; If yes, then I will create a flag.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I have this code below.&amp;nbsp; It works most of the time but also gives me false positive.&amp;nbsp; For example, it will pick up something like 121341111 – where the ‘1’ is within the string 5 or more times. &lt;/P&gt;&lt;P&gt;I want to identify only if a character is present &lt;SPAN style="text-decoration: underline;"&gt;consecutively 5 or more times&lt;/SPAN&gt;.&amp;nbsp; 121341111 should not be flagged as 1 repeated consecutively only 4 times.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: navy; font-size: 10pt;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; want(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; = i) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ssn_char ssn_rept_chars $&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;9&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp; ssn_char = ssn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; (flag=&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; substr(ssn_char, i, &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;) = substr(ssn_char, i+&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;) = substr(ssn_char, i+&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;) = substr(ssn_char, i+&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; flag=&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; flag = &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ssn_rept_chars = ssn_char;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: navy; font-size: 10pt;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 19:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215391#M53005</guid>
      <dc:creator>pr1</dc:creator>
      <dc:date>2015-04-02T19:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215392#M53006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works.&amp;nbsp; I believe there is a slicker, elegant way to value checkit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;data have;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; ssn = 123456789;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ssn = 111116789;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ssn = 123455555;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ssn = 123333339;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want(drop = i) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length ssn_char ssn_rept_chars $9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ssn_char = ssn;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; do i=1 to 5 until (flag=1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; checkit = substr(ssn_char, i, 1)||substr(ssn_char, i, 1)||substr(ssn_char, i, 1)||&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(ssn_char, i, 1)||substr(ssn_char, i, 1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if checkit = substr(ssn_char, i, 1)||substr(ssn_char, i+1, 1)||&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(ssn_char, i+2, 1)||substr(ssn_char, i+3, 1)||substr(ssn_char, i+4, 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put i= checkit= flag=;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ssn_rept_chars = ssn_char;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 19:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215392#M53006</guid>
      <dc:creator>jwillis</dc:creator>
      <dc:date>2015-04-02T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215393#M53007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array a{10}$5&amp;nbsp; _temporary_ ('00000' '11111' '22222' '33333' '44444' '55555' '66666' '77777' '88888' '99999');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _i_=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do until (flag=1 or _i_=11);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag= (index(ssn,a[_i_])&amp;gt;0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _i_+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps.&lt;/P&gt;&lt;P&gt;Would have to get slick if looking for any character repeated though&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 20:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215393#M53007</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-02T20:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215394#M53008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's giving you the false positives because you are only comparing 4 characters, not comparing 5 characters.&amp;nbsp; To compare 5 characters, two changes would be needed.&amp;nbsp; First, i should go from 1 to 5, not 1 to 6:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to 5 until (flag=1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, add another character to the list of comparisons:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... = substr(ssn_char, i+4, 1) then flag=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 20:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215394#M53008</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-04-02T20:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215395#M53009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; flag=prxmatch('/.*(\d)\1{4,4}.*/',ssn);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 05:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215395#M53009</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-04-03T05:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215396#M53010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clearly a case for a Regular Expression. As a small variation to &lt;A __default_attr="7180" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; flag=prxmatch('/.*(\d)\1{4,4}.*/',ssn);;&lt;/P&gt;&lt;P&gt;&amp;nbsp; flag2= prxmatch('/(\d)\1{4}/',ssn)&amp;gt;0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 08:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215396#M53010</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-03T08:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215397#M53011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A __default_attr="12296" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; Can you please help in letting me know the best and easiest PRX Functions documentation for a novice or first time user to comfortably understand.&amp;nbsp; Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 09:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215397#M53011</guid>
      <dc:creator>MarkWik</dc:creator>
      <dc:date>2015-04-03T09:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215398#M53012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A __default_attr="809774" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Perl Regular Expressions are not SAS specific so I'm sure there is a lot of stuff around. I don't know something specific I could recommend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within SAS:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p1vz3ljudbd756n19502acxazevk.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p1vz3ljudbd756n19502acxazevk.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;...and once you understand which SAS functions allow you to use Perl Regular Expressions (functions starting with "prx..") then the most important page is: &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p0s9ilagexmjl8n1u7e1t1jfnzlk.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p0s9ilagexmjl8n1u7e1t1jfnzlk.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because Perl Regular Expressions are not SAS specific there are a lot of expressions published and searching the Internet will very often allow to find something which comes close what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, and the Tip Sheet can also be useful in the beginning: &lt;A href="https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf" style="font-size: 10pt; line-height: 1.5em;" title="https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf"&gt;https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 09:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215398#M53012</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-03T09:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215399#M53013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much, so does that mean it is generally aimed for people who are already proficient in the use of Perl scripting language?Hmm if yes, I wonder how many languages a person like me with average to below average intelligence can learn:smileyconfused:. I appreciate your very quick response. Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 09:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215399#M53013</guid>
      <dc:creator>MarkWik</dc:creator>
      <dc:date>2015-04-03T09:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify consecutively repeating characters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215400#M53014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could learn it with "Googling" and "try and error" - so you can too!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need to learn Perl for RegEx - Perl just implemented a syntax for Regular Expression which became a quasi standard. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 09:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-consecutively-repeating-characters/m-p/215400#M53014</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-03T09:40:48Z</dc:date>
    </item>
  </channel>
</rss>

