Visual Studio Regex Find / Replace Error

I am working on using Find / Replace to change a bunch of labels to DataBound text.

I am basically trying to convert something like

<asp:Label ID="lbl213" runat="server" />

to

<%# Eval("_213")%>

Here is my regex

<asp:Label ID="lbl{\d*}" runat="server" />

Here is my replacement

<%# Eval("_\1")%>

Here is my mistake

Unknown argument to operator ':'. The full regular expression required in the search string.

How can i solve this?

EDIT:
I also tried the following

<asp{\:}Label ID="lbl{\d*}" runat="server" />

but the answer is that

The specified text was not found.

+3
source share
2 answers

Expression:

\<asp\:Label ID="lbl{:d+}" runat="server" /\>

will work just fine. You only need to avoid the colon and angle brackets.

+1
source

, . ,

\<asp\:Label ID\=\"lbl{:z}\" runat\=\"server\" \/\>
+2

Source: https://habr.com/ru/post/1739074/


All Articles