Using this pattern: char * pattern = "/([^=,]*)=(\"[^\"]*\"|[^,\"]*)/"; re-compile passes but I do not get a match on this data: char * data = "aa=88,bb=99,cc=77"; Any help would be appreciated :)