Added handling of "*" quantifier and non-greedy match