In My Project, I want to add CssClass to All asp:Buttons which don’t have the CssClass attribute.How can I use regular expressions to search and replace All?
search and replace this
<asp:Button ID="buttonSearch" runat="server" Text="Search" OnClick="buttonSearch_Click" />
into the following
<asp:Button ID="buttonSearch" runat="server" Text="Search" OnClick="buttonSearch_Click" CssClass="button-default" />
You can’t do it with “regular” VS find/replace regexes because they don’t support lookaround assertions.
You can do it using a special plugin, though. It’s called Regular Expressions Margin and supports .NET style regexes:
Search for
and replace all with