fork(21) download
  1. package main
  2.  
  3. import (
  4. "regexp"
  5. "fmt"
  6. )
  7.  
  8. func main() {
  9. var re = regexp.MustCompile(`(?m)^[0-9]{2}$`)
  10. var str = `213`
  11.  
  12. for i, match := range re.FindAllString(str, -1) {
  13. fmt.Println(match, "found at index", i)
  14. }
  15. }
  16.  
Success #stdin #stdout 0s 790016KB
stdin
Standard input is empty
stdout
Standard output is empty