View Single Post
Old 01-29-2023, 08:58 PM   #7988
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: 7,041
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by ownedbycats View Post
Regex issues again
I suspect it's a space after the 2. You're stripping - Fandom leaving Mass Effect 2_(underscore for space) which doesn't match '^Mass Effect \d$'.

By the time it gets to final output, the trailing space has been removed, but it's still there during processing.

I haven't tested it beyond the two fics given above, but I'd try something like this as a replacement for your first line. But it does remove a few additional things you didn't before, '(Movie)' and '(Movies)' for example, not just '(Movie 5)' or '- Fandom(Movies)'
Code:
## Everything you want to remove that comes in ( ) at the end of a category
## with optional spaces around the '('  ')' characters
 category=>[ ]*\([ ]*([0-9]+|Video[ ]*Games?|Movies?[ ]*[0-9]*|Comics|TV)[ ]*\)[ ]*$=>
 category=>[ ]*-[ ]*Fandom[ ]*$=>
Or just add [ ]* in front of - Fandom. I'd use it instead of most or all of the spaces just because you never know when an AO3 author will have spaces or not.
JimmXinu is offline   Reply With Quote