View Single Post
Old 06-02-2017, 09:58 AM   #2146
Atherton25
Zealot
Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.
 
Posts: 124
Karma: 3804
Join Date: May 2016
Device: Kindle Oasis 2
That's a user ID, not a storyID. Note the /u/ not /s/. It can easily be adjusted to pull one (or both) but you really don't want to extract a userID into a storyID column.

But, for your specific question/request:
(.*?) href="http(s?)://www.fanfiction.net/u/(.*?)/(?s).*
-or-
([\s\S]*) href="http(s?)://www.fanfiction.net/u/(.*?)/([\s\S]*)
will isolate and pull out the ID you're looking for.

Change /u/ to /s/ if you want only story ID's. The matching item is: \3 for the "replace with" box.

It's possible to do:
(.*?) href="http(s?)://www.fanfiction.net/(u|s)/(.*?)/(?s).*
-or-
([\s\S]*) href="http(s?)://www.fanfiction.net/(u|s)/(.*?)/([\s\S]*)
and use \4 - but keep in mind by doing this you're not distinguishing between what type of ID it is, so I would avoid that unless you have a specific reason for it.

NOTE: edited above string from initial post, to allow for additional lines of text Not sure what the before/after text looks like, but that should take care of anything else.

Anything newer seems to be HTTPS on ff.net, but I have a lot of older stuff, so I always use the http(s?) function to ensure that anything that's http:// is captured as well.

Last edited by Atherton25; 06-02-2017 at 10:20 AM. Reason: modified regex, added another string too.
Atherton25 is offline   Reply With Quote