views:

36

answers:

2

How to find all server-side tags (<asp:) that doesn't contains attribute runat in my Visual Studio 2008 / MonoDevelop solution using grep?

A: 

grep -lr "<asp:*" is the command you are looking for I think

Ravia
+2  A: 

The regex would be: <asp:((?!\brunat\s*=)[^>])*>. Note that if some attribute value contains "runat=", this won't match.

Max Shawabkeh
Sorry for dummy question, I'm very new to Linux, how call grep with such pattern?
abatishchev
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