Following is the ABNF definition using the syntax in [RFC5234] (which defines ALPHA as upper or lowercase A-Z).
did-reference = did [ "/" did-path ] [ "#" did-fragment ]
did = "did:" method ":" specific-idstring
method = 1methodchar
methodchar = %x61-7A / DIGIT
specific-idstring = idstring ( ":" idstring )
idstring = 1*idchar
idchar = ALPHA / DIGIT / "." / "-"
See Sections 3.3 Paths and 3.4 Fragments for the ABNF rules defining DID paths and fragments.
Addressed in PR #168 -- the ABNF rules for query, path and fragment components are defined in the URI RFC; they are intentionally not re-specified here.
In https://w3c-ccg.github.io/did-spec/#the-generic-did-scheme, it states...