Fixes #6253 updated regex to properly respect heredoc

Added negative lookahead to properly ignore heredocs/nowdocs with formatting.