Not really an issue, more something to leave here in case it's helpful for someone else. This is for if you have IDs that you want to validate with say FastAPI/Pydantic, and you want a regex to make sure it's valid before processing it.
This is what I have so far: [2-9A-HJ-NP-Za-km-z]{22}
It may have issues, but seems to work for me. In FastAPI you could use a Path/Query/Field and declare regex="[2-9A-HJ-NP-Za-km-z]{22}" and it should catch it, but you may want to set min_length=22, max_length=22 as well.
I'm sure this can be improved. Feel free to close out or incorporate into documentation if you think it's useful.
Hi!
Not really an issue, more something to leave here in case it's helpful for someone else. This is for if you have IDs that you want to validate with say FastAPI/Pydantic, and you want a regex to make sure it's valid before processing it.
This is what I have so far:
[2-9A-HJ-NP-Za-km-z]{22}
It may have issues, but seems to work for me. In FastAPI you could use a Path/Query/Field and declare
regex="[2-9A-HJ-NP-Za-km-z]{22}"
and it should catch it, but you may want to setmin_length=22, max_length=22
as well.I'm sure this can be improved. Feel free to close out or incorporate into documentation if you think it's useful.
Thank you!