RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Pattern Title
Expression
<(?i)(?=.[^>]*runat=["]?server)(?<TYPE>\S[^>\s]+).[^>]*id=["]?(?<NAME>\w+).[^>]*>
Description
This regular expression finds all opening tags that have the runat='server' attribute specified. It groups the type of the control (eg. asp:Label) in to a group named TYPE and the id of the control into a group named NAME. It is useful for finding all server tags or controls in an ASPX (ASP.NET) page.
Matches
<asp:Label id="Label1" runat=server> | <TABLE id="tblTable" runat=serve
Non-Matches
<table class="tableclass"> | <asp:Label id="Label2">
Author Rating: The rating for this expression. Shane O'Grady
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials