UDL to change font color of a character at a specific character count



  • I’m looking for a way to change the color of the character that falls at a specific character count on each line. For example, turn the 12th character on ever line red.



  • @All-Rfriends ,

    There’s nothing native to Notepad++ that does that out of the box.

    However, Notepad++ has plugins, including scripting languages.

    You can add extra highlighting to a builtin lexer (like the HTML lexer) or to a User Defined Language (UDL) using regexes via the script EnhanceAnyLexer.py that @Ekopalypse shares in his github repo.

    The regex would be something like (?-s)^.{11}\K(.) – I haven’t tried it, but that would be the first regex I would try = it finds first 11 characters .{11}, throws that out with \K, and then captures the single character (.). I believe that would do what you want.


Log in to reply