|  06-24-2015, 05:03 AM | #1 | 
| Age improves with wine.            Posts: 596 Karma: 95229 Join Date: Nov 2014 Device: Kindle Oasis, Kobo Libra II | 
				
				Regexp help for saving books
			 
			
			When saving books I specify the directory as {author_sort:re([.],)} to remove dots from the name, so that e.g. books by A.A. Milne are saved in "Milne, AA" However, where there are multiple authors, I want only the first author, so I want to apply a second RE to remove everything after "&": something like {author_sort:re([.],):re(\&.*$,)}, but this is of course not valid. What should I write to keep only the first author but with dots removed? | 
|   |   | 
|  06-24-2015, 07:26 AM | #2 | 
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | 
			
			Use Template Program Mode. The template will look something like Code: {author_sort:'re(re($, '\&.*$', ''), '[.]', '')'} | 
|   |   | 
| Advert | |
|  | 
|  06-24-2015, 11:04 AM | #3 | 
| Age improves with wine.            Posts: 596 Karma: 95229 Join Date: Nov 2014 Device: Kindle Oasis, Kobo Libra II | 
			
			Aha. Perfect, many thanks. I hadn't realised you could use "$" as the first argument for "re" -- where is this sort of thing documented?
		 | 
|   |   | 
|  06-24-2015, 11:31 AM | #4 | 
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | |
|   |   | 
|  | 
| Thread Tools | Search this Thread | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Help Please with saving books first last name | JDS321 | Calibre | 8 | 05-14-2014 11:57 PM | 
| saving books | iomari | Calibre | 11 | 10-04-2011 10:34 AM | 
| Regexp for series in books library | noimporta | Library Management | 14 | 05-05-2011 08:20 AM | 
| Saving after adding books | KKneko7 | Calibre | 4 | 01-17-2011 09:55 PM | 
| Problem with saving books | alchemyst | Calibre | 3 | 08-19-2010 09:14 PM |