Home Download Buy Blog Forum Support

regexes to exclude @ in sftp

regexes to exclude @ in sftp

Postby hejamartin on Mon Nov 19, 2012 10:07 am

Hi there all Sublime-lovers.

I have been banging my head - I am not a heavy coder as many of you. But I tend to try to push it most often.. making it harder for me.

I am trying to add to the regexes for the sftp-config.json

There is a ignore_regexes, in which I have added some parts - successfully.

BUT - I would love to be able to exclude uploads of folders and files that has a leading @-symbol.
I know it might be stupid to use @-symbol in files/folders.. but yeah. I have decided to be that dumb.

I have tried a whole lot "\W@" and so on.. but it does not work?

This might be easy for you to make this? Could you help me... I have googled forever, but I am not good at regex at all.

For example, this folder should be excluded
@material
as well as this file
@todo.txt

Everything with an @.


Thanks
hejamartin
 
Posts: 1
Joined: Mon Nov 19, 2012 10:01 am

Re: regexes to exclude @ in sftp

Postby wbond on Mon Nov 19, 2012 2:58 pm

SFTP compares the regex to a full file or folder path. It also compares both the / and \ form of directory separators to allow for cross-platform regexes that are not ugly. Thus, you should just be able to use:

"ignore_regexes": ["/@", …]

This will catch any file path where @ is the first character after the directory separator, or in other words, the first character of the name.
wbond
 
Posts: 528
Joined: Mon Feb 28, 2011 5:33 am


Return to General Discussion

Who is online

Users browsing this forum: estmatic, pquimo and 31 guests