Regex help needed


I know, kodi related. But somehow I get no answer over at the kodi forum.
So - if someone here has mastered the art of regular expressions (maybe summer school at Hogwarts), I’d be thankful for your help.

Within <pictureexcludes>,
I’d like to exclude all folders within my pictures folder containing “blog” in the folder name, as well as all pictures containing “blog” in their name.
What would be the regex for that?

Here’s a good tutorial about regex.

You could try:


which is a little inefficient. You could also try:


which should be more efficient but might not work with Kodi.

I had figured out this for myself but it looks wrong…
And do I need to specify the root folder?

It’s wrong if it doesn’t work. :wink:

I assume it will only apply to the location (or locations) where you’ve told Kodi to look for photos.

Haha, right you are! :slight_smile:
But, with 40000 pictures it might take some time to realize that it’s not working…
I was hoping for a quicker solution.

Copy a few hundred photos to a test location and temporarily modify Kodi only to look there.

Good idea. Will do that

Thinking about it afterwards, this might work:


ie just the word blog. It all depends on how Kodi processes its regular expressions.

For example, a simple grep:

osmc@osmc:~$ echo abcblog123 | grep blog

will find the string blog without the need for any special characters but I don’t know how Kodi works internally. You’ll need to experiment a bit.