|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 405
Karma: 692
Join Date: Sep 2006
Device: Samsung Galaxy Note 3 | Kindle Paperwhite | iPad Mini
|
Template language query. Removing all text after a set of characters
The metadata request pulls down Reviews and "About the Author" and "Excerpt" text that I want to exclude.
It looks like that data is always preceded by three number signs ### After some noodling at Rubular, it appears that this Reg Expression captures all the text after ### (actually it includes the ### which is good). \###(.*) In calibre, I tried {comments:re(\###(.*),)} However, this simply removes the ### and not the text after. Suggestions? Last edited by da_jane; 12-14-2012 at 12:37 PM. Reason: Replacing the Calibre code. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Are you making a composite custom column (column made from other columns) or are you using search/replace to remove the unwanted stuff?
Your template works fine for me when making a custom column for comments that don't contains newlines. However, it would be better written as Code:
{comments:re(###.*,)}
Code:
{comments:'re($, '(?s)###(.*)', '') '}
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with template language | Pepin33 | Calibre | 8 | 11-11-2012 09:32 AM |
| Text To Speech Query | deddajay | PocketBook | 14 | 10-28-2012 11:19 AM |
| Template language question | BookJunkieLI | Library Management | 7 | 02-02-2012 07:55 PM |
| Stupid question about calibre language template | Cammagno | Calibre | 1 | 01-08-2011 09:00 AM |
| Optional characters in Save Template for Adding Books | Starson17 | Calibre | 1 | 02-28-2010 01:52 PM |