|
You're right, with word boundaries (\b), my 2nd and 3rd regex (for words starting with bc) are more elegant:
class="[^"]*?\K\bbc[\w-]*\b
class="[^"]*?\K\bbc[\w-]{0,3}\b
In the 1st one, we have to keep the lookahead to not have a match with "bc" in "bc-de"
class="[^"]*?\K\bbc(?=[\s"])
Last edited by lomkiri; 03-29-2026 at 05:55 AM.
|