Greedy and lazy repetition The repetition operators or quantifiers are greedy They will expand the match as far as they can, and only give back if they must to satisfy the remainder of the regex – : This is a first test Place a question mark after the quantifier to make it lazy, i.e., stop matching as soon as possible – : This is a first test A better solution is to use ]+> to quickly match an HTML tag without regard to attributes –the negated character class is more specific than the dot, which helps the regex engine find matches quickly 13