06-14-2012, 04:35 AM | #1 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Regex help
How can I find and remove all occurrences of the following:
Code:
<a class="calibre7" id="pb-rw_36"></a> I've been searching the forum and trying different combinations but so far no luck. Many thanks! |
06-14-2012, 05:39 AM | #2 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
I suck at regular expressions, but this one should work:
PHP Code:
|
Advert | |
|
06-14-2012, 05:50 AM | #3 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
06-14-2012, 07:43 AM | #4 |
Evangelist
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
|
Something I often find quite handy is to clean specific empty tags with a specific attribute (id, class etc).
Code:
<(p|h\d|div|a)\b[^<>]*?(id="blarg")[^<>]*?>([\s\n\r]|&(nb|en|em|thin)sp;|</?br\s*/?>)*</\1> |
06-14-2012, 07:55 AM | #5 | |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
Another one for the collection. |
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex | Gunnerp245 | Conversion | 5 | 03-05-2012 04:15 PM |
RegEx | el.motar | Sigil | 10 | 12-12-2011 05:54 PM |
New help with a regex | txckie | Calibre | 2 | 08-29-2011 08:46 PM |
What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 05:51 AM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |