package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^[^|]*(?:\|[^|]*){58}$`)
var str = `10001|W20101|W20101|G00001||||學徒劍盾|8|9|768||-1|1||||||||40002||||||1|14||2||40027|40028|40029|40030||2|22|113|||||||||||2|50|100|7|||||
10002|W30101|W30101|G00001||||學徒大斧|9|9|768||-1|1||||||||40003||||||1|17||3||40031|40032|40033|40034||2|26|142|||||||||||2|50|100|9|||||
10479|I00208||G00005||||青鐵礦|29||0||-1|30||||3|||||||||100|5|1||54|$53$原始的礦石,整體泛著鐵青的色澤。
#IMG$NoticeIcon#30~45級的副本掉落或跟公會商人購買。
$7$能與其他材料結合,製作40級的合金材料。
|||||||||||||||||||||||||||`
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/