Popular recipes tagged "command_dispatch_pattern"http://code.activestate.com/recipes/tags/command_dispatch_pattern/2009-09-28T03:46:29-07:00ActiveState Code RecipesAutomagically dispatch commands using regex token classes (Python)
2009-09-28T03:46:29-07:00Mick Krippendorfhttp://code.activestate.com/recipes/users/4171813/http://code.activestate.com/recipes/576914-automagically-dispatch-commands-using-regex-token-/
<p style="color: grey">
Python
recipe 576914
by <a href="/recipes/users/4171813/">Mick Krippendorf</a>
(<a href="/recipes/tags/command_dispatch_pattern/">command_dispatch_pattern</a>, <a href="/recipes/tags/re/">re</a>, <a href="/recipes/tags/regex/">regex</a>).
Revision 2.
</p>
<p>The <em>(?P<...>...)</em> notation in Python's regular expressions can be viewed as a classification of matched tokens. The names of these classes can be used to dispatch tokens to appropriate handlers:</p>