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.Leonid Mamchenkov, 2011
Seine Lösung beschreibt er in seinem Blogpost PHP regular expression to match English/Latin characters only:
/** * Check that given string only uses Latin characters, digits, and punctuation * * @param string $string String to validate * @return boolean True if Latin only, false otherwise */ public function validateLatin($string) { $result = false; if (preg_match("/^[wds.,-]*$/", $string)) { $result = true; } return $result; }
Wer weiß, wofür man es einmal benötigt.