Try
Code:
{comment:'re($, '(https?://www.fanfiction.net/s/[^/]*/1/)', strcat('<p class="description"><a href="\1">', field('title'), '</a></p>'))'}
as the template.
The four changes:
- I moved the test for the 's' in https to where it belongs.
- The original example you gave me had a /u/ in it. Now it has a /s/ in it. The pattern was changed to account for that.
- Now that there is always a /1/ at the end of the URL, the capture for the id number can be simplified.
- Add a missing " at the end of the URL
For those who come along later to offer improvements (I am sure there are many), she wants to convert a URL of the form
Code:
http://www.fanfiction.net/s/1962402/1/
to the form
Code:
<p class="description"><a href="http://www.fanfiction.net/s/1962402/1/">{title of book}</a></p>