Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-17-2016, 02:53 PM   #1
iienderii
Member
iienderii began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2016
Device: PC, Google Pixel 4XL
Request: multi-search and multi-replace regex question

Hello (again)!

I tried to find a message thread that addressed this, but did not see one. I apologize if I missed it.

Here's the question:

When using search/replace in regular expression mode, is it possible to have the 'search for' area find more than one expression (in this case "Biology Today" and "Chemistry Today") - and then allow me to 'replace with' multiple expressions. So for instance, I'm searching the title field for "Biology Today" and "Chemistry Today" and I'd like to put "Biology Today" and "Chemistry Today" in the #mag_title field respectively.

The attached image illustrates what I'm talking about.

Thanks for you time!
Attached Thumbnails
Click image for larger version

Name:	searchreplace.PNG
Views:	300
Size:	19.1 KB
ID:	147957  
iienderii is offline   Reply With Quote
Old 04-17-2016, 03:15 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Replace with
Code:
\1
This will use the captured group which matched EITHER "Biology Today" OR "Chemistry Today" as the replacement text.


P.S. This is standard regular expressions syntax, so if you haven't already then I would advise you to take this regex tutorial: http://www.regular-expressions.info/
It is my favorite tutorial -- it taught me everything I know.

Make sure to cover ALL the sections!

Last edited by eschwartz; 04-17-2016 at 03:21 PM.
eschwartz is offline   Reply With Quote
Advert
Reply

Tags
regex, regular expression, replace, search, search & replace

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Multi-Column Search DaltonST Plugins 327 12-03-2022 03:08 PM
Regex search and replace dwlamb Sigil 6 04-12-2013 02:34 PM
Multi-field search ElfN Library Management 2 07-21-2012 09:36 AM
Request for Ideas: Multi-user updates mc3 Library Management 4 05-05-2012 10:15 AM
Multi-directory search daudi iRex 23 08-14-2008 07:55 AM


All times are GMT -4. The time now is 11:18 AM.


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