MQTT subscription topic match Background
MQTT (Message Queuing Telemetry Transport) is an ISO standard publish-subscribe-based messaging protocol (Wikipedia).
Each message has a topic, such as the following examples:

myhome/groundfloor/livingroom/temperature
USA/California/San Francisco/Silicon Valley
5ff4a2ce-e485-40f4-826c-b1a5d81be9b6/status
Germany/Bavaria/car/2382340923453/latitude

MQTT clients may subscribe to message topics using wildcards:

Single level: +
All levels onward: #

For example, the subscription myhome/groundfloor/+/temperature would produce these results (non-conformances in bold):
✅ myhome/groundfloor/livingroom/temperature
✅ myhome/groundfloor/kitchen/temperature
❌ myhome/groundfloor/livingroom/brightness
❌ myhome/firstfloor/livingroom/temperature
❌ garage/groundfloor/fridge/temperature
Whereas the subscription +/groundfloor/# would produce these results:
✅ myhome/groundfloor/livingroom/temperature
✅ myhome/groundfloor/kitchen/brightness
✅ garage/groundfloor/fridge/temperature/more/specific/fields
❌ myhome/firstfloor/livingroom/temperature
❌ myhome/basement/corner/temperature
More info here.
The Task
Implement a function/program accepting two strings and returning a boolean. The first string is the subject topic, the second is the criteria topic. The criteria topic uses the subscription syntax detailed above. The function is truthy when the subject matches the criteria.
Rules for this task:

Topics are ASCII
There are no criteria fields beyond the # wildcard
Wildcards do not appear in subject topics
Number of subject fields &gt;= number of criteria fields
There are no 0-character fields nor leading or tailing forward slashes

Test cases
criteria1 = &quot;myhome/groundfloor/+/temperature&quot;
criteria2 = &quot;+/groundfloor/#&quot;
(&quot;abc&quot;, &quot;ab&quot;) =&gt; false
(&quot;abc&quot;, &quot;abc&quot;) =&gt; true
(&quot;abc/de&quot;, &quot;abc&quot;) =&gt; false
(&quot;myhome/groundfloor/livingroom/temperature&quot;, criteria1) =&gt; true
(&quot;myhome/groundfloor/kitchen/temperature&quot;, criteria1) =&gt; true
(&quot;myhome/groundfloor/livingroom/brightness&quot;, criteria1) =&gt; false
(&quot;myhome/firstfloor/livingroom/temperature&quot;, criteria1) =&gt; false
(&quot;garage/groundfloor/fridge/temperature&quot;, criteria1) =&gt; false
(&quot;myhome/groundfloor/livingroom/temperature&quot;, criteria2) =&gt; true
(&quot;myhome/groundfloor/kitchen/brightness&quot;, criteria2) =&gt; true
(&quot;garage/groundfloor/fridge/temperature/more/specific/fields&quot;, criteria2) =&gt; true
(&quot;myhome/firstfloor/livingroom/temperature&quot;, criteria2) =&gt; false
(&quot;myhome/basement/corner/temperature&quot;, criteria2) =&gt; false
(&quot;music/kei$ha/latest&quot;, &quot;+/kei$ha/+&quot;) =&gt; true
Jelly, 20 bytes

ṣ€”/ZṖF”#eƊ¿œiÐḟ”+ZE


A monadic Link accepting a list of lists of characters, [topic, pattern], which returns 1 or 0 for match or no-match respectively.

Try it online! Or see a test-suite.

How?

ṣ€”/ZṖF”#eƊ¿œiÐḟ”+ZE - Link: list of lists of characters, [topic, pattern]
 €                   - for each:
ṣ                    -   split at occurrences of:
  ”/                 -     '/' character
    Z                - transpose (any excess of topic is kept)
           ¿         - while...
          Ɗ          - ...condition: last three links as a monad:
       ”#            -   '#' character
         e           -   exists in:
      F              -     flatten
     Ṗ               - ...do: pop the tail off
              Ðḟ     - filter discard those for which:
            œi       -   first multi-dimensional index of: ([] if not found, which is falsey)
                ”+   -     '+' character
                  Z  - transpose
                   E - all equal?