I am using golang regex to match an exact word with boundaries, for example "apple", "co.", I cannot simply use \b, because the word can have non alphanumeric char in the end, like the example "co."
I try something like:
test := `(?i)\b(co.)(?:\s|$)`
re = regexp.MustCompile(test)
matches = re.FindAllString("co. is a secret shortcut ", -1)
but this will give me "co. ", I would like to directly get "co.", how can I adjust my regex to achieve it.
Thanks in advance