Re: Q on RegExp & extended Char
| From: | Sven | Date: | Tue, 16 Dec 2003 09:58:25 +0000 |
| Subject: | Re: Q on RegExp & extended Char | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172783@lists.php.net to get a copy of this message | ||
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