decentralized-identity/peer-did-method-spec

Problem with regex

Closed this issue · 2 comments

The regex used doesn't seem to pass for all valid dids

^did:peer:(([01](z)([1-9a-km-zA-HJ-NP-Z]{46,47}))|(2((\.[AEVID](z)([1-9a-km-zA-HJ-NP-Z]{46,47}))+(\.(S)[0-9a-zA-Z=]*)?)))$

See here https://regex101.com/r/NSAniA/1 where there is 2 dids but only 1 is matching

It looks like the {46,47} might not account for all key sizes. Changing these to {44,47} appears to properly match

hmm 44, 47 didn't work either so I changed it to a * in my implementation

I think this was a bug in my multibase implementations. now that I have that fixed all of the dids I've tried pass the regex. closing until I see this again but I think the regex is fine as it is