Fixed regular expressions, added comments and updated description.