<?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: Problem with accented letters in the prx matching functions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322711#M71423</link>
    <description>&lt;P&gt;One more try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not famillar with prxmatch, but can you use hexadecimal in the expression ?&lt;/P&gt;
&lt;P&gt;If YES then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) use tranwrd to replace the accented letter into a non printable hexa (like 'FA'x)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;to create a temporary variable&lt;/P&gt;
&lt;P&gt;2) use prxmath with the hex expression to validate the temporary variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2017 16:50:09 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-01-05T16:50:09Z</dc:date>
    <item>
      <title>Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322670#M71406</link>
      <description>&lt;P&gt;I have PRX functions that I am using to validate strings. Here are a couple of examples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/^[A-ZÃ‘&amp;amp;]{3}\d{6}[A-Z0-9]{3}$/&lt;/P&gt;
&lt;P&gt;/^[A-ZÑ‘&amp;amp;]{3}\d{6}[A-Z0-9]{3}$/&lt;/P&gt;
&lt;P&gt;/^[A-ZÃÑ‘&amp;amp;]{3}\d{6}[A-Z0-9]{3}$/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference is sometimes only Ã is allowed in addtion to the upper case letters, sometimes only Ñ, and sometimes both ÃÑ. I&amp;nbsp;can easily handle&amp;nbsp;those variables. It appears the prxmatch function is counting the accented characters as two characters. For example, the following string"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LÑL17010ZZZ&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fails (i.e., returns a 0)&amp;nbsp;when using prxmatch. However if I change the {3} to {3,4}, it returns a 1. So my speculation is that it sees LÑL as four characters. I have run other tests and combinations that seem to confirm this speculation.&lt;BR /&gt;&lt;BR /&gt;So my question is whether there is a way to specify the Ã and the Ñ characters in the pattern so they are treated as a single character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And note that it is only these two accented letters that are allowed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 14:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322670#M71406</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2017-01-05T14:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322678#M71411</link>
      <description>&lt;P&gt;I meant to add that I did try specifying these two accented characters in the patter in hex, e.g.,:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/^[\xD1\xC3A-Z&amp;amp;]{3}\d{6}[A-Z0-9]{3}$/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;that also failed.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 15:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322678#M71411</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2017-01-05T15:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322697#M71417</link>
      <description>&lt;P&gt;So far the SAS implementation for Regular Expressions (the prx... functions) only support single byte character sets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the list which string function supports what (SBCS, DBCS, MBCS):&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/nlsref/69741/HTML/default/viewer.htm#p1pca7vwjjwucin178l8qddjn0gi.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/nlsref/69741/HTML/default/viewer.htm#p1pca7vwjjwucin178l8qddjn0gi.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322697#M71417</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-05T16:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322701#M71418</link>
      <description>&lt;P&gt;If ignoring accented letters is possible than see next solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/How-to-ignore-accented-text/td-p/140883" target="_self"&gt;https://communities.sas.com/t5/Base-SAS-Programming/How-to-ignore-accented-text/td-p/140883&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322701#M71418</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-05T16:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322704#M71420</link>
      <description>&lt;P&gt;Thanks Patrick, that is what I was afraid the answer would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And to answer Schmuel's question, ignoring them in not an option.&lt;BR /&gt;&lt;BR /&gt;It is only these characters, and accepting these characters is a key requirement for a large application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I am going to look into workaround for this (have a few ideas).&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322704#M71420</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2017-01-05T16:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322711#M71423</link>
      <description>&lt;P&gt;One more try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not famillar with prxmatch, but can you use hexadecimal in the expression ?&lt;/P&gt;
&lt;P&gt;If YES then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) use tranwrd to replace the accented letter into a non printable hexa (like 'FA'x)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;to create a temporary variable&lt;/P&gt;
&lt;P&gt;2) use prxmath with the hex expression to validate the temporary variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322711#M71423</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-05T16:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with accented letters in the prx matching functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322715#M71424</link>
      <description>&lt;P&gt;Thanks Shmuel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is exactly the approach that I was considering. This is part of a large application and we have parameterized most of the checks, including the PRX checks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the point in the process where the prxmatch function is used, I have a data set that has the values to be validated along with the pattern. So I will add logic to detect if there are accented A or accented N characters in the string to be validated. If so, I will add code to convert them to lower case a and N in both the data value and the pattern - by using temp variables. The lower case letters work for this since another part of the requirements is that only upper case characters are allows for any text/string variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So thanks for suggesting this approach as it gives me a bit more confidence that I am going down the right path.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:57:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-accented-letters-in-the-prx-matching-functions/m-p/322715#M71424</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2017-01-05T16:57:21Z</dc:date>
    </item>
  </channel>
</rss>

