Welcome Guest, Not a member yet? Register   Sign In
whitespace in validation
#6

[eluser]Flemming[/eluser]
I found that the solution described above and in the wiki for validating alpha numeric with spaces gave me the following error:
Code:
preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset...

so i changed the regex to the following:

Code:
return ( ! preg_match("/^([-a-z0-9_-\s])+$/i", $str)) ? FALSE : TRUE;

using a '\s' instead of an empty space

and that cured it.


Messages In This Thread
whitespace in validation - by El Forum - 03-04-2008, 02:11 PM
whitespace in validation - by El Forum - 03-04-2008, 03:19 PM
whitespace in validation - by El Forum - 03-04-2008, 05:00 PM
whitespace in validation - by El Forum - 03-05-2008, 01:40 AM
whitespace in validation - by El Forum - 03-05-2008, 08:40 AM
whitespace in validation - by El Forum - 08-04-2008, 09:53 AM
whitespace in validation - by El Forum - 08-04-2008, 02:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB