[PHP] Re: Q on RegExp & extended Char

2003-12-16 Thread Sven
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: $_alpha = 'a-zA-Z'; // standard latin letters $_xascii = '\x80-\xF

[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread jsWalter
I should have posted some "rules" with this... assuming: - a SPACE is used to delimit first from last name [Walter Torres] - a HYPHEN is used to separate a dual name (British style) [Conrad-Smyth] - an APOSTROPHE is used in many Irish and Scotish names [O'Reilly] - a PERIOD is used in titles,

[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread Sven
Jswalter schrieb: I've hit my limit on regular expressions. I need to check a string to see if it contains legal characters... A thru Z [a-z], SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE [\' -,\.] OK, this is not a problem. My problem comes in with extended characters, as these examples... Gonzále

[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread Jas
Well have you thought about maybe an array of illegal or extended characters and simply replacing them? eg. $b = $_POST['whatever_variables_you_have']; $match = array("ö","ç","ä"); $replace = array("o","c","a"); $z = str_replace($match,$replace,$b); Might not be exactly what you want but hope it