views:

84

answers:

3

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?

A: 

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)

James Curran
No go, it still doesn't work.
James
+1  A: 

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"
Canavar
The question mark is there to hint the ".+" to not be too greedy. But you are correct after escaping those characters and removing the question mark it seems to work fine, thanks.
James
A: 

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 :.

MNGwinn