Search for Hardcoded String in Flutter

Viewed 1032
1 Answers

If you're on IntelliJ, you can find all text matching a hardcoded String regex.

  1. Press Cmd + Shift + F (or Ctrl + Shift + F)
  2. Enable regex search
  3. Search for "(.*?)" or '(.*?)' depending on whether you use double-quotes or single-quotes for hardcoded strings. For both, use "(.*?)"|'(.*?)'
  4. Step 3 would only show a maximum of 100 results
  5. Press "Open in Find Window"

Steps 2-5

This should open a new Find window from the bottom with all results (3,144 in my case):

Search-results-collapsed

You can then expand the results directory and preview any hardcoded string in any file from the results:

enter image description here

Related