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, 08: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, 08: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: 44,825
Karma: 26594666
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, 08: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 05:51 AM
Regex Help - Add Book - Insert Filename into Custom Field nynaevelan Library Management 3 10-12-2011 02:14 PM
Calibre breaking Nook Touch hyphenation? jclim00 Calibre 8 09-04-2011 07:28 PM
Metadata Search and Replace- Delete everything in square brackets? dkelly701 Library Management 5 02-20-2011 12:50 PM
RegEx - filename metadata help ejjenkins Calibre 4 12-28-2010 06:47 PM


All times are GMT -4. The time now is 06:20 PM.


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