![]() |
#1 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Sep 2014
Device: Kindle
|
Fin/ replace a generic string
Good evening/day,
i'm trying to edit an ebook, I read the help section about finding/replacing, unfortunately, it seems I can't handle this all by my self. I'm trying to replace this character string in an ebook : Code:
<p class="calibre2"><img src="index-***_*.png" class="calibre1"/></p> Anyone can help me please? Regards Keele |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,714
Karma: 196949708
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If the numbers in the calibre class names won't ever change, then:
Code:
<p class="calibre2"><img src="index-\d+_\d.png" class="calibre1"/></p> Sorta need to know what you want to replace it with to know what to capture to build the replace expression. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Also, if you plan on doing this a lot, you might want to read a regex guide. The most helpful one I have found (and which managed to drill regex into my head
![]() |
![]() |
![]() |
![]() |
#4 | ||
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Sep 2014
Device: Kindle
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#5 | |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
![]() There is both a lengthy tutorial and a Quick Start guide: http://www.regular-expressions.info/quickstart.html The Quick Start gives you simple basics with "Learn more about ____" links to the exhaustive guide sections. It is very easy to go back and forth as needed. My favorite aspect of the guide is the breakdown of what the regex engine is doing to figure out the match. A little involved, but it helped me get clear in my head the rules of precedence for various things. Good luck! ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
Tags |
find, regular, replace, string |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replace field with match or empty string? | charlweed | Library Management | 2 | 03-29-2012 12:44 AM |
Regex - replace only part of a string - how? | flameproof | Sigil | 11 | 02-23-2012 04:43 AM |
Mathch a string while ignoring some character in that string? | ElMiko | Sigil | 12 | 12-01-2011 10:05 PM |
Find and replace string with wildcard | jhempel24 | Sigil | 15 | 11-12-2010 01:50 PM |