0

Today I had the need to change all url encoded strings like %BF to lower case ones like %bf. My first reaction is to write some Ruby scripts to do this conversion, and I began to consider use the gsub function like this gsub(/%(\d|[ABCDEF]){2}/, '\1') and then I realized that I can't change the case of the back reference.

I wondered if I can change the case of back reference and googled. I find that Vim has this ability. Here's the command that can achieve my goal:

%s,%\(\d\|[ABCDEF]\)\{2},\L&,g

Here the \L prefix means change the matched text (specified by &) to lower case.

I'm just wondering if this feature is specific to Vim, or is it also supported by other editors?

1 Answer 1

1

There are other editors that support regular expression editing. Notepad++ is another editor for Windows that supports regular expressions. How widely supported they are I can't really answer. I've got the 2 editors that I like (Vim and Notepad++) and stick with those.

Also, if any given editor has support for an add-in / extension framework then conceivably it will have support for regular expressions if / when an add-in is developed for it (if it doesn't natively have regex support already).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .