View Single Post
Old 03-08-2021, 08:05 PM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Regex for a custom identifier breaking links

I have this identifier for Open Library books: https://openlibrary.org/books/{id}/

However, i came across a strange behaviour with it. See this:

https://openlibrary.org/works/OL3965645W/Cats
https://openlibrary.org/books/OL3965645W/Cats

Though the ID works the same regardless, the URL may use either works or books. (Not sure why but i suspect it's to do with multiple editions.) If I paste in a URL with the wrong one, it fails to detect.

If I use https://openlibrary.org/(books|works)/{id}/ it does detect correctly, but then breaks the clickable links in details.

Any suggestions on what to do?

Last edited by ownedbycats; 03-08-2021 at 09:59 PM.
ownedbycats is offline   Reply With Quote