Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
([^,\s]+?)\s?=\s?\1
only full match I don't know the go
language for functions, but something like this:
1) Divide into groups (?P[^,\s]+ ?)\s?=\s?(?P[^,\s]+)
2) Get the group ${a} and the group ${b} for comparison
str := "1=1, 1=2, 1 = 1, '' = '', 3 = f"
reg := regexp.MustCompile("(?P<a>[^,\s]+?)\s?=\s?(?P<b>[^,\s]+)")
match := reg.FindAllString(str, -1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question