|  06-20-2017, 04:11 PM | #1 | 
| Addict  Posts: 224 Karma: 10 Join Date: Jul 2012 Device: Kindle | 
				
				Metadata Regex Search/Replace
			 
			
			Hola! I am trying to do what I thought was going to be a simple search and replace in the metadata editor. Here's what I need to do: Every once in a while I get a batch of books that seem to have a lot of the author initials run together and it becomes tedious to have to manually go through all the entries and manually edit them. So I need to look for connected uppercase letters in the authors field and separate them with a space. Example: Smith, John XY, or Smith, XY John, or John XY Smith, or Smith, XY The "XY" needs to come out "X Y", ie a space inserted. But NOT affect something like Smith, John Xy, or the other arrangements of that. I have tried: Code: \b([A-Z]){2}\b
And that finds the right occurrence, but can't capture it so I can insert a space.
\b([A-Z])([A-Z])\b
But that fails on the "Xy" occurrence when I use the replacement of:
\1 \2
Note the space in between.Ideas? Thanks! | 
|   |   | 
|  06-20-2017, 08:12 PM | #2 | 
| Well trained by Cats            Posts: 31,249 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | 
			
			Look at the Quality check Plugin It has bot a detect and a FIX section for this issue. Yor preset your desired format. It does many other things. Check it out. It is FREE   | 
|   |   | 
| Advert | |
|  | 
|  06-21-2017, 12:00 AM | #3 | |
| Addict  Posts: 224 Karma: 10 Join Date: Jul 2012 Device: Kindle | Quote: 
 It will indeed find all the XY initial entries so I can then put them into a virtual library to work on, but it won't actually make the change, so it is still a manual process at that point. Am I missing something the Quality Check plugin can do that will fix the Initials problem? If I can get the Metadata Editor regex to work, it will easily scan the entire library for those XY occurrences and take care of them in fewer steps. | |
|   |   | 
|  06-21-2017, 12:21 AM | #4 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | Quote: 
 BR | |
|   |   | 
|  06-21-2017, 01:26 AM | #5 | |
| Addict  Posts: 224 Karma: 10 Join Date: Jul 2012 Device: Kindle | Quote: And Thanks!!   | |
|   |   | 
| Advert | |
|  | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Regex in search problems (NOT Search&Replace; the search bar) | lairdb | Calibre | 3 | 03-15-2017 07:10 PM | 
| Regex search and replace in bulk metadata help | slantybard | Library Management | 7 | 08-20-2015 06:30 PM | 
| regex search/replace - how to? | Alt68er | Sigil | 1 | 03-11-2014 08:53 PM | 
| Regex search and replace | dwlamb | Sigil | 6 | 04-12-2013 02:34 PM | 
| regex search/replace | Sharlene | Sigil | 10 | 01-28-2012 04:14 AM |