Sublime Forum

Is this the best way to perform a recursive search?

#1

I answered this StackOverflow Question last night, and I’m wondering if there is a simpler way to go about it.
 


 
Basically: the user wants to perform multiple find_in_files searches, each time only searching within files that showed up in the previous results buffer.
 

My answer was essentially:

  • Perform first search
  • Use RegEx to extract paths
  • Use RegEx to concatenate paths into comma separated list
  • Use comma separated list as the Where: argument for the second search
  • Repeat
     

More details are shown in the question & answer @ the above link.
 


 
The reason I ask is that the RegEx steps are kind of a hassle if you’ll be using that method frequently.

If theres not a better way to do it, I’ll probably make a simple plugin that pulls the comma separated list of paths straight into the clipboard.

1 Like

#2

I suppose this would be a task for your shell + some GNU utils. You could also write a plugin, of course.

0 Likes