4 ms·
Why invent a new string matching format, instead of just using regular expressions?
by legostormtroopr 9y ago
Why invent a new string matching format, instead of just using regular expressions?
- sametmax 9y agoThey allow regular expression. But having use Django's regex matching a lot, and the one provided with werkzeug, I can tell you the second one is much more productive: 99% of the case you don't need a complex pattern and you are very happy to be able to just say "hey gime 'stuff' here" instead of crafting things like "(?P<stuff>\d+)" . For the rare use case, you just fall back on regexes.
- icepy 9y agoYou can just use regular expressions if you prefer that. * https://icepy.readthedocs.io/en/latest/tutorial.html#regular-expression-routes https://icepy.readthedocs.io/en/latest/tutorial.html#regular... * https://icepy.readthedocs.io/en/latest/tutorial.html#interpretation-of-request-path-pattern https://icepy.readthedocs.io/en/latest/tutorial.html#interpr... * https://github.com/susam/ice/blob/master/test/test_router.py#L177 https://github.com/susam/ice/blob/master/test/test_router.py...