Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2012, 07:06 AM   #1
ccsrsj
Junior Member
ccsrsj began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2012
Device: yes
Post Square brackets in filename breaking Calibre Regex?

I have a bunch of books with names such as:

Book Title [ISBN-0123456789].pdf

I've created a simple RegEx that should work

(?P<title>.+)\[ISBN-(?P<isbn>\d+)\].+

It works in various web Regex testers (such as http://gskinner.com/RegExr/)
but not in Calibre, any ideas why not?
ccsrsj is offline   Reply With Quote
Old 06-02-2012, 07:26 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
remove the .+ at the end. The regex matches the filename *without* the extension.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-02-2012, 07:38 AM   #3
ccsrsj
Junior Member
ccsrsj began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2012
Device: yes
Doh, simple as that thanks very much!
ccsrsj is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex and Metadata from filename. asrrin29 Calibre 5 12-03-2023 04:51 AM
Regex Help - Add Book - Insert Filename into Custom Field nynaevelan Library Management 3 10-12-2011 01:14 PM
Calibre breaking Nook Touch hyphenation? jclim00 Calibre 8 09-04-2011 06:28 PM
Metadata Search and Replace- Delete everything in square brackets? dkelly701 Library Management 5 02-20-2011 11:50 AM
RegEx - filename metadata help ejjenkins Calibre 4 12-28-2010 05:47 PM


All times are GMT -4. The time now is 09:15 AM.


MobileRead.com is a privately owned, operated and funded community.