pub fn strip_heredoc(input: &str) -> StringExpand description
Strip a whole-input heredoc wrapper; mirrors patch-parser.ts:33-36.
The TypeScript regex uses a backreference for the closing delimiter. Rust’s
regex crate intentionally omits backreferences, so this uses regex for
the opening heredoc syntax and then verifies the matching closing delimiter
manually to preserve the same anchored wrapper behavior.