Pchar pattern (pct encoded)

pct-encoded = “%” HEXDIGIT HEXDIGIT
DIGIT = “0”-“9”
HEXDIGIT = DIGIT / “A”-“F” / “a”-“f”

Can please someone help me understand the pct-encoded pattern. It should start with % followed by either a DIGIT or Alphas (from a to f) two times. Am I right?

That means %2A%4Bc if invalid since 4Bc > {2} and %2A%4B should be correct.

Thanks

For reference: Wikipedia Percent-encoding

Yes, pct-encoded has only two hexadecimal digits.
Therefore, %4Bc would not be parseable in the category pct-encoded.
But %2A%4B is also not a member of pct-encoded as pct-encoded only describes one percent-encoded symbol.
It is however in *pct-encoded.
And all four (%2A%4Bc, %2A%4B, %4Bc, %4Bc) are parseable with *pchar.

1 Like