Remove global variables usage and use the multiline delimiter on the regexp