views:

128

answers:

2

While testing my Google App Engine application, I search for links which include app engine keys. For example:

/story/ag5yZXBsaWUtdGVzdGluZ3IMCxIFU3RvcnkY-w0M/

What characters are allowed in these keys? I had been using the regex [a-zA-Z0-9], but it seems "-" is also allowed. What else?

Is there a reference on this? I can't find it in the App engine docs.

+1  A: 

it's very probably all digits, upper- and lowercase letters, underscore and hyphen (try to base64.urlsafe_b64decode this string ;) )

mykhal
That would be my guess also.
jldupont
+2  A: 

Google App Engine keys are encoded using URL safe base 64 encoding (see The source code for the Key datastore type).

Håvard S
So `[a-zA-Z0-9-_]` then.
Paul Biggar
I would guess its safe to say that the deployed version uses this too, and that its not just the development server.
Paul Biggar