flex icon indicating copy to clipboard operation
flex copied to clipboard

Documentation bugs about character class details

Open ricilake opened this issue 3 years ago • 0 comments

Responding to a question on stackoverflow (https://stackoverflow.com/questions/66548254/rule-patterns-used-by-flexers), I believe that the questioner identified two long-standing errors in the flex documentation.

  1. flex/flex.lexi line 927

    [[:alpha:][0-9]]

    This should read [[:alpha:]0-9]. As written, it has a completely different meaning.

  2. flex/flex.lexi line 846:

    Note that inside of a character class, all regular expression operators lose their special meaning except escape (@samp{}) and the character class operators, @samp{-}, @samp{]]}, and, at the beginning of the class, @samp{^}.

    The exception should be a single ], not two of them. Also, it should be noted that - and ] are not considered special if they immediately follow the [ or [^ which start the class, and that - is not considered special if it immediately precedes the ] which closes the character class.

ricilake avatar Mar 09 '21 16:03 ricilake