Home Download Buy Blog Forum Support

Regex for folder_exclude_patterns setting

Regex for folder_exclude_patterns setting

Postby joshhunt on Tue Sep 24, 2013 7:01 am

In my project I have the folders
Code: Select all

And I'm looking to ignore just engine/temp.

When I add just engine/temp to folder_exclude_patterns, it also matches and excludes engine/templates/ as well as engine/temp/

How can I get it to match temp/ exactly? I've tried using regex like "frontend/temp$" and the like to match just that, but that just results in nothing matching.

What am I missing here?
Posts: 2
Joined: Tue Sep 24, 2013 6:58 am

Re: Regex for folder_exclude_patterns setting

Postby chad on Wed Jun 11, 2014 5:22 am

I don't believe there's a way to do this currently. According to this SO answer, full regex is not supported in the exclude patterns, only wildcards (*). Additionally, my own testing revels that paths that begin or end with a slash are not supported.

I've opened a topic on the Sublime Issue tracker to request better path support. Issue 332. I recommend adding a comment there to increase its visibility to the Sublime devs.

I kinda doubt we'll ever see full regex support, due to performance concerns, but I hope we'll eventually get something better than what we have now.

In the meantime, one workaround is to use folder_include_patterns instead. Given your particular example, you could do something like the following. It's is not very elegant, and would need to be updated manually when you add new top-level folders, but it'd work.

Code: Select all
Posts: 2
Joined: Wed Jun 11, 2014 12:16 am

Return to Technical Support

Who is online

Users browsing this forum: raphael klaus, Yahoo [Bot] and 31 guests