fix to generalize the EOL regex