package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(````(.*)\s*([^]+?.*?[^]+?[^]+?)````)
var str = `\`\`\`markdown
## Hello
This is my new code:
\`\` <-- tutaj powinny być trzy " \` " ale psuje regex.
Tak powinna wyglądać grupa. Mój pomysł na rozwiązanie, to dodanie spacji przez trzema " \` ".
Ale jak to zrobić w regex? :x
Czy da się to jeszcze lepiej zrobić, aby użytkownik mógł pisać kod z wykorzystaniem trzech "\`"?
\`\`
\`\`\``
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/