![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 (?U)([^\s])Chapter .*</span> BobC |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,262
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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+ Code:
(Chapter \d+) |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
star 0 or more your way can offer very precise control |
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |