Fixed bug on regular expressions and added comments