By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,767 Members | 1,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,767 IT Pros & Developers. It's quick & easy.

RegEx: Want to check for missing text.

P: n/a
I'd like to check if a textbox contains text & symbols. Sometimes it will
have just carriage returns and/or spaces, and lots of them, and I want to
check if this is the case so that I can clear the multi-line textbox. What's
the RegEx expression for this?

VB.NET2003

--
|
+-- Thief_
|
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a


Thief_ wrote:
I'd like to check if a textbox contains text & symbols. Sometimes it will
have just carriage returns and/or spaces, and lots of them, and I want to
check if this is the case so that I can clear the multi-line textbox. What's
the RegEx expression for this?


^\s*$

will match a string consisting entirely of whitespace characters.
Whitespace characters are: Space, Tab, Formfeed, Newline, Carriage
return, Vertical tab. If you only want to match some of these for some
reason, they all have their own regex code: they are respectively (a
single space), \f, \n, \r, \t, \v. So if you only wanted to match
spaces and tabs you would use

^[ \t]*$

--
Larry Lard
Replies to group please

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.