w3c / payment-method-id

Payment Method Identifiers specification
https://w3c.github.io/payment-method-id/
Other
23 stars 20 forks source link

Better defined validity of standardized PMIs? #48

Closed marcoscaceres closed 6 years ago

marcoscaceres commented 6 years ago

As per spec, the following PMIs are all valid:

    "0",
    "021213213",
    "-valid-",
    "-valid-123",
    "--------",

I think what we want is:

stdpmi = part *("-" part)
part = 1loweralpha *(DIGIT / loweralpha)
loweralpha =  %x61-7A
rsolomakhin commented 6 years ago

This regex ok?

[a-z]+[a-z0-9]*(-[a-z0-9]+)*
marcoscaceres commented 6 years ago

Yeah, that looks correct.