<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Fri, 24 May 2013 00:38:12 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Leonid Mamchenkov's Blog: PHP regular expression to match English/Latin characters only]]></title>
      <guid>http://www.phpdeveloper.org/news/16739</guid>
      <link>http://www.phpdeveloper.org/news/16739</link>
      <description><![CDATA[<p>
<i>Leonid Mamchenkov</i> has a <a href="http://mamchenkov.net/wordpress/2011/08/18/php-regular-expression-to-match-englishlatin-characters-only/">quick new post</a> to his blog sharing a regular expression that can be used to check that a string contains only English or Latin characters (no Unicode allowed).
</p>
<blockquote>
Today at work I came across a task which turned out to be much easier and simpler than I originally thought it would.  We have have a site with some user registration forms.  The site is translated into a number of languages, but due to the regulatory procedures, we have to force users to input their registration details in English only.  Using Latin characters, numbers, and punctuation.
</blockquote>
<p>
Thankfully the <a href="http://www.php.net/manual/en/book.pcre.php">PCRE</a> regular expression engine bundled with PHP makes it simple - it uses a standard regular expression without anything special to accommodate for Unicode characters. He notes that adding the "/u" modifier to the expression makes it "totally malfunction" (where strings are treated as UTF-8). If you'd like an example of some of the tricks that go into supporting Unicode in a regex, see <a href="http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php#54805">this comment</a> in the PHP manual.
</p>]]></description>
      <pubDate>Thu, 18 Aug 2011 12:11:44 -0500</pubDate>
    </item>
  </channel>
</rss>
