org-tags-expand

org-tags-expand is a compiled Lisp function in `org.el'.

(org-tags-expand MATCH &optional SINGLE-AS-LIST DOWNCASED)

Expand group tags in MATCH.

This replaces every group tag in MATCH with a regexp tag search.
For example, a group tag "Work" defined as { Work : Lab Conf }
will be replaced like this:

Work => {\(?:Work\|Lab\|Conf\)}
+Work => +{\(?:Work\|Lab\|Conf\)}
-Work => -{\(?:Work\|Lab\|Conf\)}

Replacing by a regexp preserves the structure of the match.
E.g., this expansion

Work|Home => {\(?:Work\|Lab\|Conf\}|Home

will match anything tagged with "Lab" and "Home", or tagged
with "Conf" and "Home" or tagged with "Work" and "home".

When the optional argument SINGLE-AS-LIST is non-nil, MATCH is
assumed to be a single group tag, and the function will return
the list of tags in this group.

When DOWNCASE is non-nil, expand downcased TAGS.