subscribePattern
Pattern variant of subscribe: a pub/sub read on every ref-channel whose id matches the regex pattern, as seen through projection. The channel regex is built by DataSyncNamespace.refChannelPattern: it is anchored at the start and wraps pattern in a non-capturing group, e.g. subscribePattern("capy-.*") → ^(?:capy-.*) and subscribePattern("capy-.*", "admin") → ^__admin__(?:capy-.*).
The anchor matters: a hand-written ChannelGrant.pattern("capy-.*", read = true) also matches the projection mirrors (__admin__capy-1), because PAM does not anchor patterns. A leading ^ in pattern is moved in front of the prefix. A pattern anchoring several alternatives (^a|^b) is not rewritten and won't match under a projection; write it as a|b. pattern must be a valid regex on its own, so an unbalanced ) can't close the wrapping group and escape the anchor.
Like subscribe, projection only selects the channel names and adds nothing to the token meta.
Throws
if pattern is blank, only ^ or not a valid regex, or if projection is blank.