Fixed bug in regex code.