Sublime Forum

Regex syntax highlighting in the replace field

#1

Hi,

Regex search and replace is one of my many favorite features in Sublime, and I find the syntax highlighting in the “Search” field very helpful in apprehending what a given expression is going to do. Unfortunately, the same courtesy is not extended to the “Replace” field.

Would it be possible to have highlighting added to the “Replace” field?

Thanks!

0 Likes

#2

Sublimator,

Thanks - at the risk of asking a foolish question, where do I listen for the Replace window obtaining focus? Sorry, absolute n00b to both Python and Sublime’s internals…

0 Likes

#3

Making the replace field, use regex syntax highlighting, while easy (it’s a matter of adding the syntax sublimator mentioned to Packages/Default/Options/Regex Format Widget.sublime-options), isn’t quite correct - the replace string has a different syntax to the search string, and as such, a different syntax definition file is required.

The details of the replace string syntax are available at http://www.boost.org/doc/libs/1_35_0/libs/regex/doc/html/boost_regex/format/perl_format.html

I’ll add an item to the todo list to implement this.

0 Likes

#4

It’s safe to assume that it’s probably quite low on the todo list

0 Likes

#5

there’s an open feature request for this here:

1 Like