I’m a regex noob, so this may be a silly question, but why does the following not work?
{{ $highlighted := replaceRE "\?\?(.*?)\?\?" "<mark>$1</mark>" "??thing to highlight??" }}
The regex appears to be valid when testing it in http://regexr.com/, but I just get a generic syntax error in my console. If I break the regex, a regex-specific error comes out — for example, if I unescape the “?” marks. I tried it without the markup around the capture group in the second argument too, but no luck.
Hi @Heydon - I checked this out and it’s not working for me either. I’m not sure, but I think maybe your right about a missing flag or something (just looking around the forums), but TBH I don’t know. My first post was just to make sure you were checking your syntax with the same type of parser that Hugo uses.