Sublime Text 3 - Search multiple folders with regex for files in one folder
I want to search all files in folders /app/libraries
and /app/views
, but I only want to search for files starting from App
in the folder /app/models
.
If I use /app/libraries, /app/views, /app/models/App*
it gives me:
/app/models/App*:
ERROR: Unable to open file
0 matches
If I use /app/libraries, /app/views, /app/models, App*
it gives me files starting with App
in all of the folders.
I tried to get rid of the leading slash /app/libraries, /app/views, app/models/App*
suggested by this answer , but I get this:
Searching 0 files for "search string" (regex, case sensitive)
0 matches
source to share
The point here is that you used a wildcard pattern when you need a regex pattern.
To match any number of characters in wildcard patterns, an asterisk is used, but in regex patterns, you can use either .*
(any 0+ characters except line break characters), or - if you only want the match App
as part of the filename (and therefore no more /
allowed) - you can use [^/]*
(zero or more characters other than /
.
So use
/app/models/App.*
or
/app/models/App[^/]*
source to share