Search code examples
regextextpluginstext-editor

Is there an editor or plugin for more potent regular expressions?


Regular expressions are great for text editing. But sometimes they aren't quite enough. For example, say I have a text with 1000 sentences, with the first character in lowercase:

my name is Foo. hello, how are you? i really like this forum. ... etc.

And I want to convert them so that the first letter is capitalized. This IS possible with regular expressions, but the regular expression you need is very long and untidy. One of the things I like the most of regexs is the possibility to catch parts of the string in parenthesis and use them with $i or \i or whatever for replacement.

My question is: do you know an editor or plugin for an editor where you can process this capturing groups in some sort of language (say, Python?). This would allow us to do such things as:

search for:
^(.)(.*)$
and replace that with:
toUpperCase($1)$2


Solution

  • Regexbuddy for the win. Jeff Atwood's blog (Coding Horror) mentions it a few times.