DAMN GAE.
It seems that repetitions (both needed or optional) are ignored if not captured in a grouping.
This is surfacing now because we didn't have any x.y.z release where either of x, y or z were two digits instead of one.
Summary:
this was plain wrong
/(.+?)/static/_\d.\d.\d\/(.+)
as
in regex terms wouldn't had allowed you to use (using x.y.z as the
example) to have a x.y.zz.
/(.+?)/static/_[\d]+\.[\d]+\.[\d]+/(.+)
is
more correct from a regex POV, because sintactically it allows you to
have AT LEAST one digit for every x, y, or z, ("+" is "one or more").
Unfortunately, GAE seems to NOT respect regex syntax and maps correcly
x.y.z but not xx.yy.zz nor xx.y.z nor x.y.zz
/(.+?)/static/_(\d+\.\d+\.\d+)/(.+)
this
is exactly as before, but the _1.2.3 part is now part of a grouping.
This means that the backreferences must be shifted (static_files:
applications/\1/static/\3 instead of static_files: applications/\1/static/\2). But in now the "rewrite" works, while the previous didn't
in
regex terms, this means that _1.2.3 NEEDS to be in a group to allow
both _1.2.3 and _123.123.123 to work fine. Strangely enough the regex
syntax (that is documented to work fine) doesn't work if not inside a
grouping.