-
The arguments to
replaceRE
are in the wrong sequence.replaceRE PATTERN REPLACEMENT INPUT [LIMIT]
-
The regex patterns are easier to create and understand when written as string literals (surround pattern with backticks instead of quotation marks).
-
You can simplify your pattern like this:
`(?s)\x60{3}ad-(.+)\ntitle:\s*(.+?)\n(.+)\x60{3}`
1 Like