![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
Template Help in S&R
Hello.
Chaley kindly helped me with the following template for S&R and I fiddled a bit with it, because I needed both http and https. When I tried with the following I got an invalid group reference. Code:
Template: {#story_url:'re($, '(http(s?)://www.fanfiction.net/s/[0-9]*?/)', strcat('<p class="description"><a href="\1>', field('title'), '</a></p>'))'} Search for: .* Replace with: \1 Destination Field: #story_url The original story link could be either: https://www.fanfiction.net/s/7950093/1/ or http://www.fanfiction.net/s/1962402/1/ It varies if there's is s in the address but always the same with id-number and then the /1/ in the end. I hope someone can help me. Thanks in advance. Last edited by Tanjamuse; 09-10-2017 at 06:24 AM. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Try
Code:
{comment:'re($, '(https?://www.fanfiction.net/s/[^/]*/1/)', strcat('<p class="description"><a href="\1">', field('title'), '</a></p>'))'} The four changes:
Code:
http://www.fanfiction.net/s/1962402/1/ Code:
<p class="description"><a href="http://www.fanfiction.net/s/1962402/1/">{title of book}</a></p> |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
Thanks Chaley.
It seems to work like a charm. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle newbie needs "template" HTML & CSS | Rich_H | Kindle Developer's Corner | 12 | 09-10-2012 11:16 PM |
Kindle Newbie needs "template" HTML & CSS | Rich_H | Workshop | 4 | 09-10-2012 08:33 PM |
PRS-500 Template & extended font support at Feedbooks (poll) | Hadrien | Sony Reader Dev Corner | 9 | 05-12-2007 12:04 PM |