replaceRE not working for me [SOLVED]

Hugo uses the Go regular expression package which uses the re2 syntax. This is not pcre or javascript, so whatever syntax validator you’re using online may have some differences.

I suspect your problem is that you are trying to match a multi-line input string and need to turn on the multi-line flag with (?m). See this Go playground for an example of using the flag and what’s happening inside of Hugo.

3 Likes