|
|
#811 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 516
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
|
|
|
|
|
|
#812 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 686
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
|
I'm removing many <a href ... /a> around text (in many files). Most of the time it's fine, sometimes it catches too much.
Example: <a href="../../f70d_0040.smil#rgn_txt_0040_0006" class="pcalibre2 calibre4 pcalibre1 pcalibre">text</a> should become text I use: Search: <a href=".*?(?<=smil).*?">(.*?)</a> Replace: \1 But, like in this case, it catches all this (instead of only the second href with ".smil" inside (I want to keep the note)). <a href="v014884_split_068.html#note-d2e8351" class="pcalibre noteref pcalibre1 pcalibre2" id="id_3738">88</a> <span id="id_3739"> <a href="../../d202_100.smil#txt_2555" class="pcalibre calibre4 pcalibre1 pcalibre2">text</a> I've been playing around but can't seem to find a reliable way to only get the <a href ... /> which contains ".smil". Any ideas from you gurus?
|
|
|
|
|
|
#813 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,934
Karma: 207182180
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Instead of .*?
Try using something like [^>]* It prevents things from going beyond the closing bracket of a tag So altogether: something like: Code:
<a href=[^>]*(?<=smil)[^>]*>([^>]*)</a> |
|
|
|
|
|
#814 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 686
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
|
You rock!
![]() That seems to work perfectly! I learn something every time I read you guys posts. Thanks. |
|
|
|
|
|
#815 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,934
Karma: 207182180
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Happy it worked for you!
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 07:00 PM |
| Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 04:23 PM |
| Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 09:24 PM |
| Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 04:49 PM |
| Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 05:23 AM |