Path expression segments starting with digits #134

davisagli opened this Issue Nov 30, 2012 · 6 comments


None yet
2 participants

davisagli commented Nov 30, 2012 uses this regexp to validate path expressions:

    path_regex = re.compile(
        r'^(?:(nocall|not):\s*)*((?:[A-Za-z_][A-Za-z0-9_:]*)' +

This means that a segment of the path cannot start with a digit. That was supported in the reference implementation. (I have a template called and used to be able to use its macros, but cannot with chameleon.)

malthe was assigned Nov 30, 2012


malthe commented Nov 30, 2012

Interesting, because that regex comes from zope.tales.


davisagli commented Nov 30, 2012

Really? I don't see it there.


malthe commented Nov 30, 2012

Hmmm... maybe not, hehe. But did I write that long regex? Time flies, I guess.


davisagli commented Dec 1, 2012

I committed a fix (r128467). What's the best way to write a test for it?


malthe commented Dec 5, 2012

For a minute there, I thought: hey, that's an SVN revision..

The tests in have always been against regressions and somewhat ad-hoc, so I have just adapted an existing test to whatever situation came up.

But in the case of regular expressions such as this one, I think a doctest in the class is great, and straight-forward to add.


malthe commented Dec 5, 2016

Seems this was already fixed years ago so we can close the issue here.

malthe closed this Dec 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment