Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kstenerud
· 12y ago · 0 comments
Actually, it only needs to be \[([^,]+),([^\]]+)\] because you're only going up to a comma in the first capture group and a square bracket in the second.
Comments
[–]
poolunion
12y ago
That would also match all of "[a] more [b,c]" though.
[–]
kstenerud
OP
12y ago
And the other regex would match all of "[a more [b,c]". Your regex must be designed around your expected input.