Jump to content

how to allow white space eregi()


partha

Recommended Posts

Hai Friends,I want to get some input from user. It may be more than one word.In eregi(), i am not able to accept the white space.if (!eregi("^[(0-9a-z_)]+[(0-9a-z)]$", $name)){ echo ("Invalid");}I have tried, /s*, /s+ and many more. But, no use.I hope, friends can help me.Thanks and regards,T.R.Parthasarathy

Link to comment
Share on other sites

I am using PHP. I have referred so many sites and i have tried it. But, i did not get the result.

In regular expressions, special characters are escaped with a back-slash (\) rather than a forward-slash (/).Have you tried "\s"?
Link to comment
Share on other sites

Hi,Thanks,I am using PHP. I have used backslash, forward slash, and * + and so many.But, I did not any +ve results.Can u help me by sending correct code.Thanks and regards,T.R.Parthasarathy.

Hai Friends,I want to get some input from user. It may be more than one word.In eregi(), i am not able to accept the white space.if (!eregi("^[(0-9a-z_)]+[(0-9a-z)]$", $name)){ echo ("Invalid");}I have tried, /s*, /s+ and many more. But, no use.I hope, friends can help me.Thanks and regards,T.R.Parthasarathy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...