Kodi Community Forum

Full Version: Regex Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok, I'm trying to make a regex to match the filenames in my anime collection, I've already added the regexs from the other topic and they work fine, but most of my collection has been renamed for the sake of cleanliness in a format like:

Title of the Anime - episodeNumber [malID][subgroup if avaiable]

where episodeNumber has a zero in front of it for the first 9 episodes and malid is something that the software I use to keep it sorted uses to make the anime recognition faster and it's something like [MID#2251#11] where the first number is the database id of the anime on myanimelist.net and the second number is the episode.

That said, if someone can make me a regex I'd be happy but I'm not really expecting that, I posted since I have some questions about the regexes I really don't understand:

How do I tell xbmc stuff like:
- the title/episode number/season is here
- if there's no season number assume it's 1

(bold for people who don't want to read everything Rolleyes)

The rest of the regex I should be able with a bit of work to understand by myself (I hope) Tongue
Assuming:

Something - ## [MIDsomething.ext

Code:
<regexp> - ([0-9]+) \[MID</regexp>

A single catch in the regexp means it'll use the episode number and assume season 1.

Cheers,
Jonathan
thanks a lot Big Grin
I should be able to finish it on my own now