Do you know about a technique that can speed up your coding experience for almost all the code editors in the world?
Code Editors, the long debate 😁
Choosing a code editor is a long (and never-ending) debate though. The choice of code editor totally depends on your needs as well as your comfort. There is no perfect for all code editor. The one that you prefer, may not be a good option for someone else. So, explore multiple code editors to find your favorite one. (Remember, I'm talking about code editors, not IDEs 😑). Some of the top trending GUI code editors today are:
- Visual Studio Code by Microsoft
- Atom by GitHub
- Sublime Text by John Skinner
- Brackets by Adobe
Also, there are some CLI code editors like Vim and Nano.
But all GUI editors have one common feature!
Regular Expressions in Code Editors
Most of the time, especially when modifying a previously written code. We all use Find (CTRL+F) and Replace (CTRL+H) features to search a previously coded module, features, variable, or method. Although this feature is very good, Regular Expressions can increase their productivity up to a great extent.
Usage of RE in Code Editors
I personally use the Visual Studio Code. So, I'll illustrate 3 very basic examples of using regular expressions to search for specific content in the codebase.
*Note that you must turn on RE feature as shown in the image below:
1. Match any single character (except a line break)
can match any sequence such as cms
, crm
, or c3s
etc.
2. Match multiple characters
can match any sequence such as cases
, comes
, c43s
etc.
3. Match at the beginning of a sentence
can match all the lines starting with user
.
There are many more ways to use Regular Expressions for searching the codebase.
You can find Regular Expression usage in Visual Studio Code and Visual Studio IDE. If you are using some other editor, google its docs!
Hope you like this! 😉
Top comments (2)
Thanks
My Pleasure :)