changes to regexpr to correct matches