while ($page =~ /(.*?)<\/b>/g) { # Now $1 contains the matched text }