We are currently working on improving our REST API and we need to implement the optional 'fields' parameter for some actions. Therefore, we would like it to recognize the pattern of the request in the same manner Facebook is currently doing:
GET https://graph.facebook.com/me?fields=name,birthday,photos.limit(10).fields(id, picture)
After some google searches, we didn't find anything. So far, we came to this (incomplete) solution:
(?<expr>(?&term)(?:[,](?&term))){0} (?<term>(?&value)(?:[.](?&mod))){0} (?<mod>(limit|fields)\((?&expr)\)){0} (?<value>\w*){0} ^(?&expr)$
The semantic and syntax used is PCRE with the modifier x (PCRE_EXTENDED)
Completely different solutions are also more than welcome.
Thanks in advance.