08-28-2011, 04:23 AM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Aug 2011
Device: Panditigal Novel
|
New help with a regex
I am using this regex at the moment:
" ^(?P<author>((?!\s-\s).)+)\s-\s(?:(?:\[\s*)?(?P<series>.+)\s(?P<series_index>[\d\.]+)(?:\s*\])?\s-\s)?(?P<title>[^(]+)(?:\(.*\))? " I now need to add publisher to my regex. My books are in this format Author - [Series Series Index] - Title [Publisher](epub).epub Example: JR Ward - [Black Dagger Brotherhood 03] - Lover Awakened [Signet] (epub).epub Any help would be appreciated. |
08-29-2011, 04:12 PM | #2 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
You can try just dropping \s\[(?P<publisher>.*+\]\s in after your title. |
|
Advert | |
|
08-29-2011, 08:46 PM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Aug 2011
Device: Panditigal Novel
|
I have books in several different formats. This regex seems to cover most of them. Examples:
JR Ward - [Black Dagger Brotherhood 03] - Lover Awakened (epub).epub JR Ward - Black Dagger Brotherhood 03 - Lover Awakened.epub JR Ward - Lover Awakened.epub I got it from an example on this forum. It is not my own but it seems to work better than the ones I was originally using. I had to switch back and forth between them to make them work and they didn't work for all my files. (?P<author>[^_]+) - (?P<title>.+) (?P<author>[^_]+) - (?P<series>[^-]+) (?P<series_index>[^-]+) - (?P<title>.+) Thanks so much for your help |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
regex help please | thevoiceofcheese | Calibre | 2 | 08-01-2011 11:27 PM |
Regex | Faster | Sigil | 2 | 04-24-2011 09:08 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 help... | Bobthebass | Workshop | 6 | 04-26-2009 03:54 PM |