VS Code Find by Regex Pattern

Jayasingh
2 min readMar 2, 2020

--

Today I was doing lazy loading in my React js project and I was removing import statement one by and rewriting lazy component for those.

Since this is a big project and I was running out of patience to do any more copy-paste repeat stuff for each.

So I figured out an easy way to find and replace my import statement. Which will at least lessen the burden on me

  1. In VS Code when using find (Ctrl+F)

2. Type (.*from) in Find field and enable the .* in search options as shown below

3. All the text that follows this pattern will be selected and highlighted

I am looking to a pattern match replace also like in programming. I will update if I figure out that as well.

The above piece of information was so much useful for me and I hope it was the same for you as well. Do give some claps if you find this info useful.

--

--