From: Dirk Gouders Date: Wed, 18 Nov 2026 18:38:53 GMT Subject: Re: [PATCH v2] utf8: add display_mode_esc_sequence_len_counted() Message-ID: In-Reply-To: On Wed, Nov 18 2026, Andy Koppe wrote: >> Dirk Gouders > And as far as I know, we would need an FSM to identify valid sequences >> if we are going to allow colons. > No. The parameter field can be any mix of digits, colons and > semicolons. Semicolons separate parameters, colons separate > subparameters, and individual (sub)parameters can be empty, which is > equivalent to zero. If the field consists of nothing but colons, > that's one parameter with multiple empty subparameters. My statement was a bit misleading, because display_mode_esc_sequence_len() already is an FSM accepting the language "\033\[[0-9;]+m". My concern was that I doubt that simply adding ":" to the alphabet and as valid input to the state "parameter" (without introducing one or more new states) would still let it accept only valid SGR sequences. It seems I can learn something: is "\033[:;m" a valid SGR sequence? But, such a discussion is difficult without defining what language you want to accept. I guess the two links were meant as a definition and I have to confess I didn't yet read them. Regards, Dirk