View Single Post
Old 03-29-2026, 05:44 AM   #6
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 191
Karma: 1537710
Join Date: Jul 2021
Device: N/A
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.
lomkiri is offline   Reply With Quote