The best way to get better at regexes is to use them - practice, practice, practice! So what's the best way to give yourself the opportunity to practice?
Here are some ideas:
Use a text editor that supports making changes using regexes, for instance vim or ed. By forcing yourself to use regexes for all text changes you get the basics down pretty quickly.
Use tools like sed and grep on the command line at every opportunity. Both are driven by regexes.
The cost of this approach is that you will suffer an initial hit on productivity. But it will pay off on the end.
The best way to get better at regexes is to use them - practice, practice, practice! So what's the best way to give yourself the opportunity to practice?
Here are some ideas:
Use a text editor that supports making changes using regexes, for instance
vim
ored
. By forcing yourself to use regexes for all text changes you get the basics down pretty quickly.Use tools like
sed
andgrep
on the command line at every opportunity. Both are driven by regexes.The cost of this approach is that you will suffer an initial hit on productivity. But it will pay off on the end.
sed
andgrep
are fantastic tools! 100% recommended!