Visual Studio Search Issue
-
23-08-2019 - |
Question
I have a problem in VS2005. When I try to search files with the regular expressions option I just get an error message stating
Unknown argument for ':' operator. Complete Regular Expression required in search string.
The pattern that i'm trying to use is valid, and works in other text editors it is:
<asp:textbox.+?(type="text"|size=|autocomplete=|class=|value=)
How do I get this pattern working with VS2005 search?
Solution
This is working :
\<asp\:textbox.+?(type=\"text\"|size=|autocomplete=|class=|value=)
But I think there is a mistake in .+? part. Wtihout it I can get matches for that :
// <asp:textboxtype="text"
OTHER TIPS
try:
< asp\:textbox.+?(type="text"|size=|autocomplete=|class=|value=)
(blank between less-than and "asp" added to appease wmd editor. It shouldn't be there)
The specific cause of your error is that visual studio regular expression searching uses : to indicate character types, and :te isn't a character property. Escaping the : with a \ will cause it to be read as a :.