Hi,
Recently i've switched to PHP 5.3+ and after that migration i learned that the eregi() function has been depreciated, its the function i mostly used for my regex needs.
But now i had to switch to preg_match() function, i am having trouble validating a certain condition.
Hello World
I want the preg_match to validate the above "hello world" string, the string contains whitespace in it.
But i want it to validate even if there is no whitespace "helloWorld" or just "hello".
What i'm trying to do is that in my script i have a text-field for the category title, i want it to accept spaces in it and no other special characters (such as ._-+*,).
I have made it to work but i'm not sure if thats the right way which i'm using.
preg_match('/^[a-zA-Z0-9\s]*$/', $cat_name);'
Any help would be appreciated.