Regex Help

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Bard Offline
Junior Member
Posts: 2
Joined: Nov 2009
Reputation: 0
Post: #1
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 :rolleyesSmile

The rest of the regex I should be able with a bit of work to understand by myself (I hope) Tongue
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #2
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

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Bard Offline
Junior Member
Posts: 2
Joined: Nov 2009
Reputation: 0
Post: #3
thanks a lot Big Grin
I should be able to finish it on my own now
find quote