Here it is https://github.com/slevithan/xregexp/blob/master/README.md#xregexpmatchrecursive

And it's available as of https://github.com/zotero/zotero/pull/213

Use Zotero.Utilities.XRegExp to access the RegExp object. Everything else should be the same as in examples on XRegExp README