It matches all the elements that have no attribute id contained.
Used mainly in ascx controls. The reason is that .NET runtime automatically adds id attributes
and you can not modify their values. It might be something like "ctl0", "ctl10" etc.
Therefore you can find for example (after appropriate modifying) elements like
<asp:Button CausesValidation="false" Text="click me" runat="server" />
You can easily alter the expression so that it can be used for
any element without given attribute.
When working on the coloring script, I used regular expressions quite heavily. Until them I rarely
had occassion to prove how excellent tool regular expressions are. But then I felt this time they could be
useful, so I opened Expresso and started learning again. The "The 30 Minute Regex Tutorial" with Expresso
is excellent and surely worth reading.
During the fun I found some of them at least a little bit interesting. Do you know you can match a prefix/sufix (without
capturing it)? Or the absence of prefix/suffix? The 30 min tutorial brings this pieces to light. And what about
conditional expression? That sounds good, doesn't it. The only thing this tutorial is missing is better explanation
of working with stack - balancing group. Never mind, can be found elsewhere..
if/else/while if their prefix is either start of the line (
^) or non-letter/digit
zero-width positive lookbehind
Any non-word character
^ (anchor to start of string)
Capture to <key>
Matches all variables starting with "$" except key words
$null/false/true/_/args. First it looks forward
if there is something like $null\W or $false\W etc.
- If so, then matches nonsense string $^ - it means that the whole
expression doesn't match the string.
- If not, then it matches the string starting with "$" and continuing until non-letter/digit character is matched.