12-16-2009, 05:32 PM | #1 |
Member
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 |
12-16-2009, 05:36 PM | #2 |
creator of calibre
Posts: 44,419
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Easier to use
Code:
'[XVIL]+' |
Advert | |
|
12-16-2009, 05:55 PM | #3 |
Member
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.
|
|
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 and Resources (No Self-Promotion or Affiliate Links) | 1 | 08-19-2006 12:13 PM |