Reputation: 37464
My test data:
<div class="row"></div> // should match
<div class="row line"></div> // should match
<div class="item row line"></div> // should match
<div class="rowBody"></div> // shouldn't match
var $itemRow = 1; // shouldn't match
I'm trying to replace all instances of the class row
from a codebase.
My miserable attempts:
row[\W]{0}
and
row[\W]
Obviously neither have worked, what would I be looking for?
Upvotes: 1
Views: 561
Reputation: 336198
That's what word boundary anchors are for:
\brow\b
Such an anchor matches the (zero-length) position between a character of the \w
set and either a character of the \W
set or a string boundary (start/end).
Upvotes: 3