How to find all server-side tags (<asp:
) that doesn't contains attribute runat
in my Visual Studio 2008 / MonoDevelop solution using grep?
views:
36answers:
2
+2
A:
The regex would be: <asp:((?!\brunat\s*=)[^>])*>
. Note that if some attribute value contains "runat=", this won't match.
Max Shawabkeh
2010-02-02 10:33:26
Sorry for dummy question, I'm very new to Linux, how call grep with such pattern?
abatishchev
2010-02-04 12:24:00
Unfortunately plain grep does not support lookaheads, but you can do it with Perl using:`perl -lne "/<asp:((?!\brunat\s*=)[^>])*>/ and print" myfile`
Max Shawabkeh
2010-02-04 13:27:15