I have a two strings like this
mystr = "xyz/10021abc/f123"
mystr2 = "abc/10021abd/c222"
I want to extract 10021abc and 10021abd. I came up with
r = regexp.MustCompile(`(?:xyz\/|abc\/)(.+)\/`)
But when I want to extract the match using this:
fmt.Println(r.FindString(mystr))
It returns the entire string. How should I change my regex?