Improved regexes to be more general