0

Hi All,

I need to have a Regex that will not allow just spaces, but it can allow sentences with spaces. It should allow any special characters that occur as well.

Actually, it is for a text area of comments. So i want to restrict him from entering just spaces.

Well, i tried

1. ^[^\\s]*$
2. ^[a-zA-Z0-9^\\s]*$

If any variation of the second one works, i'm willing to type out the entire special characters set that is there in the keyboard.

Any help would be much appreciated.

Thanks,
Adarsh

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by adarshcu
0

Thanks for the tip.

I used String.trim() to achieve the same. Silly mistake.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.