View Single Post
Old 04-30-2015, 12:31 PM   #117
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,990
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by chrnno View Post
On that note was thinking of how to get every reasonable variation of say Harry Potter for example to replace to that, would this generally work?
Code:
 category=>(^.*Harry .*Pott?er.*$|^.*HP.*$)=>Harry Potter
If you're willing to assume there aren't other HP titles you'll ever want. That would also catch 'Maximizing HP', for example. (Hit points or horse power--take your pick.)
Quote:
Originally Posted by chrnno View Post
And then realized people also use author's name so...?
Code:
 category=>^.*Rowling.*$=>Harry Potter
Again, with the caveat that not all Rowlings are JK. Just most.
Quote:
Originally Posted by chrnno View Post
And because once I started thinking on it I couldn't help it. To get all variations of Lord of the Rings and The Hobbit when including Tolkien, book or novel change to Lord of the Rings(Book) and The Hobbit(Book) but otherwise to Lord of the Things(Movies) and The Hobbit(Movies) would this work?
Code:
 category=>^.*Hobbit.*(Tolkien|Book|Novel).*$=>The Hobbit(Book)
 category=>^.*Lord of the Rings.*(Tolkien|Book|Novel).*$=>Lord of the Rings(Book)
 category=>^.*Hobbit.*$=>The Hobbit(Movie)
 category=>^.*Lord of the Rings.*$=>Lord of the Rings(Movie)
That particular sequence isn't going to do what you want because category=>^.*Hobbit.*$=>The Hobbit(Movie) will also apply to the The Hobbit(Book) you just changed to above it. Ditto for movie.

The best way to find out what regex will do is try them. And FanFicFare will help you out there. In personal.ini you can define test stories and give them whatever metadata you want to try out:
Code:
[teststory:1003]
title:Some Other Title
category_list:Thor (Movies),Marvel Cinematic Universe,The Avengers (Marvel Movies),Captain America (Movies),xyz,Harry Potter,a little bit fluff,angst and fluff,Hurt/Comfort,Percy Jackson and the Olympians & Related Fandoms - All Media Types
characters_list:Fred Weasley,George,Frigga (mom),Wesley W.P.,Wesley WaP.
genre_list:Action,Romance
chaptertitles:Prologue,Chapter 1\, Xenos on Cinnabar,Chapter 2\, Sinmay on Kintikin,3. Chapter 3,Chapter 4,Chapter 5,Chapter 6,Chapter 7,Chapter 8
ships_list:Thor/Jane,Bob
rating:G
Then add/update-always/update-calibre with story url test1.com?sid=1003. Just make sure the replace_metadata you're trying to test are in [defaults] or [test1.com].
JimmXinu is offline   Reply With Quote