bug fix....was not reading the file properly when regex was provided