Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-16-2009, 05:32 PM   #1
Blurr
Member
Blurr began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2009
Device: none
regex search for roman numerals

I'll preface this by saying that this is the first time I've used regex.

using the expression

//h:b[re:test(., '\bX{0,2}V?I{0,3}V?X?\b')]

to search for roman numerals but it's still picking up words with an I in them like CHOICE or HOLIDAY. shouldn't the word boundry \b markers take care of that, or do they not "collapse" in when no X or V is found?

there may be a better and more efficient way to do this, but like I said, this is one of the first regex lines I've written.

Thanks
Blurr is offline   Reply With Quote
Old 12-16-2009, 05:36 PM   #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: 26,117
Karma: 5101571
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Easier to use

Code:
'[XVIL]+'
which makes use of the fact that there are no (or very few) words made up only of the letters X,V,I or L
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 12-16-2009, 05:55 PM   #3
Blurr
Member
Blurr began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2009
Device: none
Heh, wow, just a tad more efficient. Still needs the \b markers though or it picks up words with an I in them. Thanks.
Blurr is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can calibre creat a TOC by reading numerals as chapter marks p3aul Calibre 7 10-04-2010 04:18 AM
PRS-900 Times New Roman and PDF vxf Sony Reader 2 06-18-2010 09:02 AM
Regex search author field to locate books? Starson17 Calibre 2 12-21-2009 10:40 AM
Non-roman fonts ebookworm Sony Reader 6 10-06-2007 12:12 AM
Google Book Search to search full-text books online Bob Russell Deals, Freebies, and Resources (No Self-Promotion) 1 08-19-2006 12:13 PM


All times are GMT -4. The time now is 10:34 AM.


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