Need some help with RegEx for scraping TV
#1
Hey guys,

My source directory in XMBC is 'TV', and my shows are structured like this:

Code:
TV\Showname\S07\E08\... ...ext

I want to use RegEx in advancedsettings.xml so that the scraper will only pick up "Showname\S07\E08\" and ignore everything after that (for example, there can be other folders inside 'E8' that might contain wrong season/episode numbers, and the file name itself can have a wrong season/episode number).
There's only one episode in 'E08' of course.

I'm a newbie to RegEx and I was hoping I could get a little help here. I'd appreciate anything I could get Smile

Thanks in advance
Reply
#2
Code:
<tvshowmatching action="prepend">
  <regexp>[\\/]s([0-9]+)[\\/]e([0-9]+)[\\/]</regexp>
</tvshowmatching>
That should handle your naming scheme. Only the first match will be used anyway, so anything after will be ignored.

...However, that doesn't allow for multi-episode naming, but how to handle that depends a lot on how you deal with it in your naming scheme

For example, something like:
Code:
<tvshowmatching action="prepend">
  <regexp>[\\/]s([0-9]+)[\\/]e([0-9]+)([^\\/]*)[\\/]</regexp>
</tvshowmatching>

Would work on:
Code:
TV\Showname\S07\E08E09\... ...ext
(or \S07\E08-09\).
Reply
#3
Perfect! Tested on multi-episodes as well and it works flawlessly. Thanks a lot!
Reply

Logout Mark Read Team Forum Stats Members Help
Need some help with RegEx for scraping TV0