<?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: Can prxpattern and prxmatch be used with XSD patterns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268689#M53204</link>
    <description>&lt;P&gt;Right! "12345 &amp;nbsp; " will not match either because of the trailing spaces, but trim("12345 &amp;nbsp; ") will match.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2016 21:31:37 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-05-05T21:31:37Z</dc:date>
    <item>
      <title>Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268532#M53164</link>
      <description>&lt;P&gt;I need to validate data values before generating an XML file. The XML file specifies patterns for a number of the fields. But they are not standard PERL regex's. XSD patterns are apparently a limited subset and the syntax is slightly different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you plug an XSD pattern into prxmatch, it rejects the syntax.&lt;BR /&gt;&lt;BR /&gt;I did find a reference that said you could take an XSD pattern and prefix it with a ^ and suffix it with a $ to convert it to a Perl regex. But prxpattern rejects that also. If you remove the $, it rejects it because it wants a close ^. Adding a ^ as the first and last character results in (for the examples I have checked) a valid pattern. But it seems to accept patterns that are not valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So does anybody have any advice on how to convert an XSD pattern to something that can be used in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TIA.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 14:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268532#M53164</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2016-05-05T14:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268650#M53193</link>
      <description>&lt;P&gt;Give examples of XSD patterns.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 19:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268650#M53193</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-05T19:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268664#M53196</link>
      <description>&lt;P&gt;Meant to include a representative set. Thanks for the reminder. Here is a subset from just one of the XSD files.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;[A-Z\d\._'\-]+@[A-Z\d_'\-]+\.[A-Z\d\._'\-]+&lt;BR /&gt;[A-Z]{2}&lt;BR /&gt;[A-Z]{4}\d{6}[MH][A-Z]{5}[0-9]{2}&lt;BR /&gt;[A-ZÑ ]{1,200}&lt;BR /&gt;[A-ZÑ&amp;amp;]{3,4}\d{6}[A-Z0-9]{3}&lt;BR /&gt;[A-ZÑ&amp;amp;]{3}\d{6}[A-Z0-9]{3}&lt;BR /&gt;[A-ZÑ&amp;amp;]{4}\d{6}[A-Z0-9]{3}&lt;BR /&gt;[A-ZÑ0-9]{1,14}&lt;BR /&gt;[A-ZÑ\d #\-\.&amp;amp;,_@'()]{1,254}&lt;BR /&gt;[A-ZÑ\d \-\.,':/$]{1,3000}&lt;BR /&gt;[A-ZÑ\d \-\.,:/]{1,100}&lt;BR /&gt;[A-ZÑ\d \-_\.&amp;amp;,'#@]{1,200}&lt;BR /&gt;\d{1,14}\.\d{2}&lt;BR /&gt;\d{1,2}&lt;BR /&gt;\d{4}[0|1]\d{1}&lt;BR /&gt;\d{4}\-\d{1,9}&lt;BR /&gt;\d{5}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Found &lt;A href="http://www.regular-expressions.info/xml.html" target="_blank"&gt;this site&lt;/A&gt;&amp;nbsp;that discusses the differences. I tried the suggestion to prefix the pattern with a ^ and suffix it with a $. But that did not create an expression that prxparse accepted. &lt;BR /&gt;&lt;BR /&gt;Also found a few sites that decode the pattern into a description. From which I could presumably create a valid perl regex expression. But given how many of these I have to create, I would prefer to avoid that approach if at all possible.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 20:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268664#M53196</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2016-05-05T20:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268678#M53200</link>
      <description>&lt;P&gt;Seems like all you need to add is a pair of delimiters&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;\d{5} &amp;nbsp; --&amp;gt; &amp;nbsp;/\d{5}/ &amp;nbsp;will match a substring of 5 digits&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;\d{5} --&amp;gt; /^\d{5}$/ will match if the whole string is 5 digits&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 20:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268678#M53200</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-05T20:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268680#M53201</link>
      <description>&lt;P&gt;Very helpful.&amp;nbsp; Thx.&amp;nbsp; So let me first acknowledge that&amp;nbsp;to say I am a novice on regex patterns would give me too much credit.&lt;BR /&gt;&lt;BR /&gt;So, am I correct in assuming that prefixing with /^ and suffixing with $/ will check for an exact match. So for example, 12345x, will fail because it is not an exact match?&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 20:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268680#M53201</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2016-05-05T20:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268689#M53204</link>
      <description>&lt;P&gt;Right! "12345 &amp;nbsp; " will not match either because of the trailing spaces, but trim("12345 &amp;nbsp; ") will match.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 21:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268689#M53204</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-05T21:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268690#M53205</link>
      <description>&lt;P&gt;Thanks. I had already thought about that and was doing a strip of the string.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 21:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268690#M53205</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2016-05-05T21:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268719#M53209</link>
      <description>&lt;P&gt;Note that if you want to match accented letters, the pattern&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;[A-ZÑ0-9]{1,14}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can be&amp;nbsp;extended using a posix character class&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;[[:upper:]0-9]{1,14}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you need to catch other accented letters.&lt;/P&gt;
&lt;P&gt;The letters matched depend on the encoding. For example wlatin1 matches most Western Europe accents like&amp;nbsp;Ñ (Spanish) or Ø (Swedish).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Taken from &lt;A href="http://www.amazon.com/High-Performance-SAS-Coding-Christian-Graffeuille/dp/1512397490&amp;nbsp;" target="_blank"&gt;http://www.amazon.com/High-Performance-SAS-Coding-Christian-Graffeuille/dp/1512397490&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 01:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268719#M53209</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-05-06T01:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can prxpattern and prxmatch be used with XSD patterns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268770#M53236</link>
      <description>&lt;P&gt;Thanks. For now this project is using UTF-8 encoding and we only need to support Spanish. But this is a good tip.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 11:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-prxpattern-and-prxmatch-be-used-with-XSD-patterns/m-p/268770#M53236</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2016-05-06T11:36:37Z</dc:date>
    </item>
  </channel>
</rss>

