<?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 Case-Folding span? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370130#M65082</link>
    <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand the explaination for the code of &lt;FONT face="Verdana-Bold" size="2"&gt;&lt;STRONG&gt;\u&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;$1&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\L&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$2&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\E.&amp;nbsp;&amp;nbsp;Could someone help?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2012/CT-03.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2012/CT-03.pdf&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;The replacement expression then makes use of &lt;/FONT&gt;&lt;I&gt;&lt;FONT face="Verdana-Italic" size="2"&gt;case-folding prefixes &lt;/FONT&gt;&lt;/I&gt;&lt;FONT face="Verdana" size="2"&gt;and &lt;/FONT&gt;&lt;I&gt;&lt;FONT face="Verdana-Italic" size="2"&gt;spans&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;to control the case of the capture buffers. &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;\u &lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;makes the next character that follows it&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;uppercase, which would be the &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;d &lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;or &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;m &lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;in first capture buffer. The case-folding span &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;\L&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;makes characters that follow lowercase until the end of the replacement or until disabled by&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="CourierNew" size="2"&gt;\E&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;, which is applied to the second capture buffer. Case-folding functionality was introduced&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;in SAS V9.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;data guest_list ;&lt;/P&gt;&lt;P align="left"&gt;input attendees $30. ;&lt;/P&gt;&lt;P align="left"&gt;datalines;&lt;/P&gt;&lt;P align="left"&gt;MR and MRS DRaco Malfoy&lt;/P&gt;&lt;P align="left"&gt;mr and dr M Johnson&lt;/P&gt;&lt;P align="left"&gt;MrS. O.M. Goodness&lt;/P&gt;&lt;P align="left"&gt;DR. Evil&lt;/P&gt;&lt;P align="left"&gt;mr&amp;amp;mrs R. Miller&lt;/P&gt;&lt;P align="left"&gt;;&lt;/P&gt;&lt;P align="left"&gt;run ;&lt;/P&gt;&lt;P align="left"&gt;proc sql ;&lt;/P&gt;&lt;P align="left"&gt;select attendees&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;, prxchange( 's/\b(d|m)(r(?!a)s?)/&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\u&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$1&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\L&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$2&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\E&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;/io', -1, attendees ) as attendees2&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;from guest_list&lt;/P&gt;&lt;P align="left"&gt;;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2017 19:43:41 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2017-06-23T19:43:41Z</dc:date>
    <item>
      <title>Case-Folding span?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370130#M65082</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand the explaination for the code of &lt;FONT face="Verdana-Bold" size="2"&gt;&lt;STRONG&gt;\u&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;$1&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\L&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$2&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\E.&amp;nbsp;&amp;nbsp;Could someone help?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2012/CT-03.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2012/CT-03.pdf&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;The replacement expression then makes use of &lt;/FONT&gt;&lt;I&gt;&lt;FONT face="Verdana-Italic" size="2"&gt;case-folding prefixes &lt;/FONT&gt;&lt;/I&gt;&lt;FONT face="Verdana" size="2"&gt;and &lt;/FONT&gt;&lt;I&gt;&lt;FONT face="Verdana-Italic" size="2"&gt;spans&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;to control the case of the capture buffers. &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;\u &lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;makes the next character that follows it&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;uppercase, which would be the &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;d &lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;or &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;m &lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;in first capture buffer. The case-folding span &lt;/FONT&gt;&lt;FONT face="CourierNew" size="2"&gt;\L&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;makes characters that follow lowercase until the end of the replacement or until disabled by&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="CourierNew" size="2"&gt;\E&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;, which is applied to the second capture buffer. Case-folding functionality was introduced&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;in SAS V9.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;data guest_list ;&lt;/P&gt;&lt;P align="left"&gt;input attendees $30. ;&lt;/P&gt;&lt;P align="left"&gt;datalines;&lt;/P&gt;&lt;P align="left"&gt;MR and MRS DRaco Malfoy&lt;/P&gt;&lt;P align="left"&gt;mr and dr M Johnson&lt;/P&gt;&lt;P align="left"&gt;MrS. O.M. Goodness&lt;/P&gt;&lt;P align="left"&gt;DR. Evil&lt;/P&gt;&lt;P align="left"&gt;mr&amp;amp;mrs R. Miller&lt;/P&gt;&lt;P align="left"&gt;;&lt;/P&gt;&lt;P align="left"&gt;run ;&lt;/P&gt;&lt;P align="left"&gt;proc sql ;&lt;/P&gt;&lt;P align="left"&gt;select attendees&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Verdana" size="2"&gt;, prxchange( 's/\b(d|m)(r(?!a)s?)/&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\u&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$1&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\L&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$2&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\E&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;/io', -1, attendees ) as attendees2&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;from guest_list&lt;/P&gt;&lt;P align="left"&gt;;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370130#M65082</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-23T19:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Folding span?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370149#M65084</link>
      <description>&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;'s/\b(d|m)(r(?!a)s?)/&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\u&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$1&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\L&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;$2&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Verdana-Bold" size="2"&gt;\E&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here dr mr mrs&lt;/P&gt;
&lt;P&gt;can be representated as (d|m) &lt;FONT face="Verdana" size="2"&gt;)(r(?!a)s?) which means first word can be eitther d or m&amp;nbsp; and second word is r not folowed by a and there could be s &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;| = or ? 0 or 1 time .&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;when ever you keep anything in parenthesis its value is captured &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;as (d|m) is first value it value is captured and &amp;nbsp;can be replace $1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;second captured value is r(?!a)s?)&amp;nbsp; and can replaced by $2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&amp;nbsp;u&lt;/FONT&gt;&lt;/STRONG&gt;$1 --means make your&amp;nbsp; captured first&amp;nbsp;value&amp;nbsp; upper case .&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;L&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;$2 means&amp;nbsp;make &amp;nbsp;your&amp;nbsp; captured&amp;nbsp; second value&amp;nbsp; lower case.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;I have tried my best to explain. Please let me know if something is not clear or something appears wrong&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 20:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370149#M65084</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-06-23T20:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Folding span?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370301#M65095</link>
      <description>&lt;P&gt;I'm still trying to learn regular expressions but, like you, I often find the terminology misleading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, in this case, \&lt;FONT face="Verdana-Bold" size="2"&gt;&lt;STRONG&gt;u&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;$1 simply means to upcase the one character (D or M) that was identified in the first capture. that falls under the description "case-folding prefixes". However, since it was only one character, it would work with either \u$1 or \U$1, since the upper case U means to span over the entire capture.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;The span over entire capture is called in the other call, namely \L$2, which insures that both the "r" and, if it exists, the "s" are shown in lower case. The \E ends the string that is being searched (thus the term span used in the terminology but, in this case, wasn't needed as the "s" defines the end of the search already.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;It gets more confusing, though (to me at least), when you consider the first part of the string, as it defines not only what is captured, but also what will cause the string to be changed. What I was most confused about, in this case, is why Ken chose to exclude cases where the character "a" came before the "s". I, for the life of me, don't see why that was relevant.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;Art, CEO, AnalystFinder.com&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2017 21:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Case-Folding-span/m-p/370301#M65095</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-24T21:04:43Z</dc:date>
    </item>
  </channel>
</rss>

