Jswalter schrieb:

...
 - allow apostrophes, but only if preceded *and* followed by a Alpha/Extend
 - allow hyphen/dash, but only if preceded *and* followed by a Alpha/Extend
...

hi walter,
how about something like this:

<?php

$_alpha  = 'a-zA-Z';         // standard latin letters
$_xascii = '\x80-\xFF';      // extended ascii-codes
$_achar  = $_alpha.$_xascii; // allowed characters

$regex = '/^['.$_achar.']+(\'|-)['.$_achar.']+$/';

?>

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to