Jump to content

I can't get regular expression to work in my ignore.conf file


Recommended Posts

I'm trying to ignore files by using regular expressions, but it seems like none of the expression work. I looked at the documentation and also tried some simple cases and examples from the docs, but nothing seems to work. For example:

I have two files:
abc_0.txt
abc_1.txt

In my ignore.conf the rule:
^abc_[0-9].txt$

But the files still show in the pending changes list. If I put abc_0.txt in the ignore file, it is correctly hidden from the GUI and ignored.

Is there something I'm missing or are regular expression currently broken?

Link to comment
Share on other sites

Ok thanks, that works!

It took me a little while to understand but I think I undestand this now:

^/abc_[0-9].txt$ will match abc_0.txt but not Assets/abc_0.txt which is what I want.

^*abc_[0-9].txt+$ will match both files because the star is like "any path"

 

I still don't really understand why ^abc_[0-9].txt$ doesn't work, because I don't have to start other file patterns with a slash either and its also a fully valid regex expression in other tools I'm using.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...