DEV Community

Martin
Martin

Posted on

Finding all <MyComponent ... someProp=...> via vscode fulltextsearch

When I need to find all occurrences in my codebase where a certain component is used and a certain property is provided usually my first attempt does find nothing. Because this is where we need multiline matching; and I can't memorize how it's done. Have to look it up every single time (Stackoverflow).

So I'll now write it down here; for the next time I will need it.

Dear future me,

so we're looking for <MyComponent> and need to find any place that sets the property foobar, is that right?
Use the following pattern via the vscode fulltextsearch box with RegEx enabled:

<MyComponent(.|\n)+?foobar=
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.