ietf-openpgp
[Top] [All Lists]

Re: [openpgp] Possible ambiguity in description of regular expressions: [^][]

2020-12-27 04:57:58
Hi Daniel,

Thanks for following up.

On Thu, 24 Dec 2020 14:58:18 +0100,
Daniel Kahn Gillmor wrote:
nice find!  it's rather ugly, though.

Thanks for confirming my suspicions.

the most straightforward way to resolve it seems to be to say that
sequences in a [] must be non-empty.

Indeed.

This means we don't get to say "[]", but that's ok because we already
have ".", which will handily replace it with the same semantics.  We
also don't get to say "[^]".  While i don't know how to replicate the
"no match" semantics, i'm also unclear where it could possibly be
useful.

For a non-empty regex, you can use an anchor where it doesn't belong.
So, 'a^' won't match anything.  Likewise, '$a' won't match anything.
This is obviously context sensitive, so it is not a perfect
replacement, but I don't think "no match" is that useful in practice.

Seems like a sufficient clarification would be:

-A range is a sequence of characters enclosed in '[]'.
+A range is a non-empty sequence of characters enclosed in '[]'.

We need to exclude [^] as well.  Perhaps:

+A range is a non-empty sequence of characters excluding the optional
leading ^ enclosed in '[]'.

Neal, perhaps you want to formally file this as an erratum on rfc4880?

I'll do that.

Thanks,

Neal

_______________________________________________
openpgp mailing list
openpgp(_at_)ietf(_dot_)org
https://www.ietf.org/mailman/listinfo/openpgp

<Prev in Thread] Current Thread [Next in Thread>