11-01-2009, 05:55 PM | #1 |
Connoisseur
Posts: 99
Karma: 14
Join Date: Jun 2008
Location: Brisbane Australia
Device: iPod Touch, Ipad, Kindle 2
|
Regex help needed
can any experts out there please help me with extracting series from a title
[Otherland 03] I need to pull the series and series index and lose the [ ] I can get the entire thing to series but cant work out how to seperate them this is what I have to date (?P<author>[^_-]+) -?\s*(?P<series>.+?)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? Gratefully appreciate help Cheers Tony |
11-02-2009, 07:43 AM | #2 |
Enthusiast
Posts: 41
Karma: 5514
Join Date: Oct 2009
Location: Groningen, Netherlands
Device: PRS-T1
|
I don't quite understand the question. What result do you expect?
e.g. [Otherland 03] series=Otherland index=03 ? |
Advert | |
|
11-04-2009, 10:27 AM | #3 |
Enthusiast
Posts: 33
Karma: 112
Join Date: Jul 2009
Device: Sony PRS-505
|
this is what I'm using... it requires the space-hyphen-space between author, series(if there) and title, but it will filter out the brackets
(?P<author>[a-zA-Z'. ]+?) - \[?((?P<series>[a-zA-Z' ]+) (?P<series_index>[0-9\.]+)\]? - )?(?P<title>[^\.]+).* |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapter detection when only digits - regex needed | Perkin | Calibre | 15 | 09-20-2010 06:25 PM |
What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 05:51 AM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |
RegEx REPLACEMENT: Help needed! | LARdT | Sigil | 12 | 01-04-2010 07:25 PM |