View Single Post
Old 06-30-2010, 07:36 AM   #1
bigbot3
Junior Member
bigbot3 began at the beginning.
 
Posts: 4
Karma: 30
Join Date: Jun 2010
Location: Amsterdam
Device: Kobo Forma and H2O 1st gen
Custom Regular Expressions for adding book information

Hi,
I would like to start a thread about recipes for regular expressions
to extract book information from the file names

Here are a few to start with:

Standaard Calibre:

(?P<title>.+) - (?P<author>[^_]+)
example "Murder on the golf links - Agatha Christie.epub"

Title: Murder on the golf links
Author: Agatha Christie
Series:
Series Index:



\s*(?P<series_index>[0-9]*)\s*(?P<title>[^_].+) ?- (?P<author>[^_]+)

example "40 Murder on the golf links - Agatha Christie.epub"

Title: Murder on the golf links
Author: Agatha Christie
Series:
Series Index: 40.0


\s*((?P<title>(?P<series_index>[0-9]*)\s*[^_].+)) ?- (?P<author>([^_]+))

example "40 Murder on the golf links - Agatha Christie.epub"

Title: 40 Murder on the golf links
Author: Agatha Christie
Series:
Series Index: 40.0


\s*((?P<title>(?P<series_index>[0-9]*)\s*[^_].+)) ?- (?P<series>(?P<author>([^_]+)))

example "40 Murder on the golf links - Agatha Christie.epub"

Title: 40 Murder on the golf links
Author: Agatha Christie
Series: Agatha Christie
Series Index: 40.0


Maybe it would be handy to have a dropdown box for the regular expression field with a history in it to choose from.
Iam not to handy with reg. exp. and when experimenting sometimes i lose
the correct syntax.
Further I love Calibre, it is a wel composed program and a natural complement to my Sony PRS-600 reader.
bigbot3 is offline   Reply With Quote