Add multiline switches to regexes when needed