5 ms·
Regular expression search and replace is also killer.
by julianb 18y ago
Regular expression search and replace is also killer.
- ajross 18y agoYes. Although if you're still learning regexes, I'd suggest staying away from the emacs implementation. It's different from perl's (or pcre, which is the library that everything not perl actually uses) syntax, which is the one you really want to know. There are a bunch of annoying incompatibilities.
- msg 18y agoI've found I don't miss much from Perl 5. The only things I've found really funny are backslashing special operators that you don't in Perl, like \( \| and \{. Oh, and \s- for whitespace is very weird to me. And there's no \d. And instead of $1 in the replacement, you do \1. Once I got used to it, I found them very close to each other, at least for everything I do. Like Steve Yegge (in Effective Emacs), I alias query-replace-regexp and use it every day. Lots of other good tips and pointers to interesting topics there. http://steve.yegge.googlepages.com/effective-emacs http://steve.yegge.googlepages.com/effective-emacs
- silentbicycle 18y agoM-x re-builder can help you learn them interactively, though.
- davidw 18y agoWow, that's a cool one... I love that about emacs: even after years of using it, I'm still learning lots of cool things.