Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r, _ := regexp.Compile("m([a-z]+)ch")
- fmt.Println(r.FindStringIndex("much match"))
- // [0 4]
- fmt.Println(r.FindStringSubmatchIndex("much match"))
- // [0 4 1 2]
- fmt.Println(r.FindAllStringSubmatchIndex("much match", -1))
- // [[0 4 1 2] [5 10 6 8]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement