Question

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

Basically I'm trying to convert something like

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

to

<%# Eval("_213")%>

Here's my regex

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

Here's my replace

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

Here's my Error

Unknown argument for ':' operator. Complete Regular Expression required in the search string.

How would I resolve this?

EDIT:
I also tried the following

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

but the response is that

The specified text was not found.

Was it helpful?

Solution

The expression:

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

will work just fine as well. You only need to escape the colon and the angle brackets.

OTHER TIPS

Well holy crap. You basically have to escape EVERYTHING that's not a text character

\<asp\:Label ID\=\"lbl{:z}\" runat\=\"server\" \/\>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top