I want to prevent users from entering url\'s (like a href=\"\") in a TextBox.
I want to use a regular expression validator but no idea what to write?
How ca
As you mention ASP.NET you might want to try a Regex Validator which checks the input to ensure there are no URL patterns present. Have a look at this MSDN Article.
This regex should do the trick: @"^(?!.*(mailto\:|(news|(ht|f)tp(s?))\://).*).*$"
@"^(?!.*(mailto\:|(news|(ht|f)tp(s?))\://).*).*$"