Sublime Forum

Regexes to exclude @ in sftp

#1

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

0 Likes

#2

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.

0 Likes