I read that golang doesn’t have lookahead/lookbehind in regex, so how do I achieve the following requirement?
I want to remove the dots in all occurrence of: class=".class1 .class2 (possibly more) " so the output becomes: class=“class1 class2 “. It would be simple if there’s only one class per element, I’ll just use replaceRE class=”[.]([^. ]+)”, however if the number of classes is unknown, I can’t figure out how to replace for all occurrences without lookahead/lookbehind, since bracket only returns the last group of a match.
I thought about use range and findRE, but variables within {{ range }} is local and can’t easily replace variable outside of it.