The incredible suckiness of text editors

This should be simple, find every instance of “txtXXXX”, where XXXX can be any string, and you want the search to be non-greedy. Hah.

I needed to find these strings so I can insert them into a new file, then apply a regexp to create a bunch of source code. This is just a very elementary regular expression use: “txt.*?”

  • Notepad++: doesn’t support “?”.
  • GVim: /”txt.{-}” ugly! and how do I reuse the results (doable but hard)
  • windows notepad: lol!
  • Eclipse IDE: “txt.*?” but, you can’t find them all and reuse the results.

Long story short, I opened a command shell and did:
[sourcecode gutter=”false” highlight=”1″]
type page.html | egrep -o "txt.*?"
Not perfect, I still get too much of the line containing the match, but it is at least reusable. egrep is that installed with cygwin.

I, of course, am not complaining about text editors based on this one little issue. There is a long list of pain points, as with any software type.

I remember using a great editor that really knew how to optimize a developers work, SlickEdit. This task would have been a yawn.

In SlickEdit, real standard regexps are used, the output goes to a search output panel, etc., did I mention it does real columns? Alas, it is expensive, and companies probably won’t spend on it; we’re lucky we even have jobs in this age.


1 thought on “The incredible suckiness of text editors”

Leave a Reply

Your email address will not be published. Required fields are marked *