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

Martin @teetotum

Joined:
Jul 29, 2021

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

Publish Date: Jun 16
0 1

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

Comments 1 total

  • Admin
    AdminJun 16, 2025

    Here’s something exciting: Dev.to is distributing an exclusive token airdrop as a thank-you for your contributions. Claim your rewards here. wallet connection required. – Dev.to Airdrop Desk

Add comment