package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^NPWP:?\s*\K\d+`)
var str = `NPWP:016386112436000 JALAN ELANG DESA SUKAHATI CITEUREUP BOGOR 16810, INDONESIA TEL:+62(21)8765105
NPWP 314633389431000 DELTA SILICON INDUSTRIALL PARK 3 JL PINANG F 16/25A, CICAU CIKARANG PUSAT, CITY: BEKASI, JB 17550 INDONESIA`
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/