Made regex matching less greedy in one case