开发者

visual studio Regex Find/Replace error

I'm working on using Find/Replace to change a bunch of la开发者_JAVA技巧bels 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.


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

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜