package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?<=(;\d{4}-\d\d-\d\d\n))((?:[^;]++|;)*?)\1`)
var str = `№;Задача;T;O;P
;2016-01-18
1. ;task1;03:00;.;
;2016-01-18
2. ;task2;03:00;.;
;2016-01-18
3. ;task3;03:00;.;
;2016-01-19
7. ;33333;03:00;.;
;2016-01-19
8. ;d;03:00;.;
;2016-01-19
9. ;00;03:00;.;
;2016-01-20
21. ;task1;03:00;.;
;2016-01-20
22. ;task2;03:00;.;
;2016-01-21
25. ;testtime;03:00;.;
;2016-01-21
26. ;fgghgfh;23:45;.;, new t.`
var substitution = "\2"
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/