Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-18-2014, 10:41 AM   #1
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
Ungreedy matching in S&R

Is the (?U) PCRE modifier supposed to work in a search string in the editor ?

I keep getting an "unknown extension" error :

Code:
calibre, version 1.20.0
ERROR: Unhandled exception: <b>error</b>:unknown extension at position 2

calibre 1.20  isfrozen: True is64bit: False
Windows-XP-5.1.2600-SP3 Windows ('32bit', 'WindowsPE')
('Windows', 'XP', '5.1.2600')
Python 2.7.5
Windows: ('XP', '5.1.2600', 'SP3', 'Uniprocessor Free')
Traceback (most recent call last):
  File "site-packages\calibre\gui2\tweak_book\boss.py", line 638, in search
  File "site-packages\calibre\gui2\tweak_book\search.py", line 292, in get_regex
  File "site-packages\regex\__init__.py", line 331, in compile
  File "site-packages\regex\__init__.py", line 481, in _compile
error: unknown extension at position 2
when I use the search expression :

(?U)([^\s])Chapter .*</span>

BobC
BobC is offline   Reply With Quote
Old 01-18-2014, 11:34 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: 45,262
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://docs.python.org/2.7/library/re.html
kovidgoyal is offline   Reply With Quote
Advert
Old 01-18-2014, 12:04 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,966
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
The trailing '?' is a ungreedy quantifier

I regularly use:
for spelled numbering
Code:
(Chapter .+?)\w+
for digit numbering: (no need to worry about closing spans with this
Code:
(Chapter \d+)
theducks is offline   Reply With Quote
Old 01-18-2014, 01:19 PM   #4
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
@kovid

Thanks for the reference, I couldn't see what I was looking for at first in the help files.

@theducks

Thank you for pointing me to the appropriate non-greedy qualifier. I've now been able to strip out about 1500 pointless <span>...</span> elements from a book.

I did know about the /d+ notation but tend to use /d{1,} out of habit from a different regex variant I used in LibreOffice work.

BobC
BobC is offline   Reply With Quote
Old 01-18-2014, 01:31 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,966
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by BobC View Post
@kovid

Thanks for the reference, I couldn't see what I was looking for at first in the help files.

@theducks

Thank you for pointing me to the appropriate non-greedy qualifier. I've now been able to strip out about 1500 pointless <span>...</span> elements from a book.

I did know about the /d+ notation but tend to use /d{1,} out of habit from a different regex variant I used in LibreOffice work.

BobC
plus 1 or more
star 0 or more

your way can offer very precise control
theducks is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching Book Titles FaF Library Management 5 09-20-2013 08:45 AM
Searching Published matching Date Perkin Library Management 0 09-22-2011 05:35 AM
Better matching/scanning lbutlr Calibre 3 08-04-2010 03:44 PM
Matching Light for Kobo dixieknits Kobo Reader 2 07-19-2010 02:50 AM
Literary Pattern Matching kennyc News 5 12-16-2009 03:12 PM


All times are GMT -4. The time now is 05:02 PM.


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