View Single Post
Old 10-28-2011, 04:38 PM   #24
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Surely something simple like :
Code:
(?mi)^(?P<isbn>[\d\-x]{9,17})
Would work better? It includes some leeway for -'s which are often used to space isbn's.

And for fun, here's an over-complex regex to pull out the potentially useful stuff from that formatting :
Code:
(?P<isbn>[\d\-xX]{9,17})\.(?:(?P<publisher>(?:[\w]+\s[\w]*)+)\.)?(?P<title>.+?)(?P<datefudge>(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\w*\.\d{2,4})?(?:\.[^\.]+[\n\r$])
Serpentine is offline   Reply With Quote