I wonder if MagicPython project could be useful to implement this. Currently, it has a pretty comprehensive test suit: https://github.com/MagicStack/MagicPython/tree/master/test/fstrings And it has f-strings grammar defined in a yaml file: https://github.com/MagicStack/MagicPython/blob/master/grammars/src/pyfstring.inc.syntax.yaml At the very least, it could serve as a widely adopted reference (Atom, Sublime, and VS Code use it). I also wrote a very naive and wrong hack for personal use, based on php-mode: ``` (defconst python-f-string-regexp "{[[:word:]]+\\.?[[:word:]]+?}") (defun python-f-string-font-lock-find (limit) (while (re-search-forward python-f-string-regexp limit t) (when (python-syntax-comment-or-string-p) (put-text-property (match-beginning 0) (match-end 0) 'face 'font-lock-variable-name-face))) nil) (with-eval-after-load 'python (font-lock-add-keywords 'python-mode `((python-f-string-font-lock-find)) 'append)) ``` (I'm really sorry, I don't know how to format monospaced text in debbugs)