[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pygment regex question

From: Jean Abou Samra
Subject: Re: pygment regex question
Date: Fri, 25 Nov 2022 17:54:41 +0100

> Le 25 nov. 2022 à 17:16, Luca Fascione <> a écrit :
> well -3 seems to be matching it, (say in a-3, I'm aware this is a
> fingering/articulation mark, not a duration).
> It appears to be an attempt to match a signed integer followed by zero or
> more dots.
> It sucks that pygments regexes are context free, though.

? What do you mean by context-free? I assume you are not using it in the CS 
sense of context-free grammars and languages?

> This should be using regex capturing and be more like
> `[a-g]((?:\d+|\\longa|\\breve)\.*)` or better yet
> be more like `[a-g]((?:2|4|8|16|32|64|128|\\longa|\\breve)\.*)`, it's not
> like a5 is a valid token...

Sorry, I don’t understand your remark. Why would the regex above not work in 
Pygments and what problem would this regex solve?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]