View Single Post
Old 06-28-2014, 12:45 AM   #3043
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by JimmXinu View Post
First, when posting personal.ini settings, please use 'code', not 'quote' tags (it's the hash sign button). That way it preserves the spacing and we can copy & paste from each other without having to put all the spaces in at the beginning of lines.

Second, I'm not sure what's causing your problem precisely, but I can tell you how to significantly reduce your replacement list and fix the problem.

The key is that you're not using the power of the regular expressions to work for you. The character '.' in regexp means "any character". '*' means "zero or more of the previous character".

So you can put '.*' in your expressions and match anything instead of having a line for each possible version used.

You'll need to double check and test it, but I think this will work for all the cases you had before.

Code:
replace_metadata:
 fandoms=>Arrow \(TV 2012\)=>Arrow
 fandoms=>Batman \(Comic\)=>DCU
 fandoms=>Red Robin \(Comic\)=>DCU
 fandoms=>Harry Potter.*=>Harry Potter
 fandoms=>Hawaii Five-0 \(2010\)=>Hawaii Five-0
 fandoms=>Marvel.*=>Marvel
 fandoms=>Teen Wolf.*=>Teen Wolf
 fandoms=>Rise of the Guardians.*=>Rise of the Guardians
 fandoms=>Star Trek.*=>Star Trek
 fandoms=>Supernatural RPF=>Supernatural
 fandoms=>Iron Man=>Avengers
 fandoms=>.*(Captain America|Thor|Avengers|Agents of S.H.I.E.L.D.|X-Men|Spider-Man).*=>\1\,Marvel
(You may have realized that that means 'Agents of S.H.I.E.L.D.' will also match "Agents of SzHzIzEzLzDz". In general, you can escape '.' with '\.' like '(' and ')'. In that particular case, the odds hitting something else that also matches are so small as to be negligible.)
Hi, I will give this a try and yes it would be nice to cut down the amount of lines I'm using. Sorry about using quotes instead of code, I'll use code next time.

Thanks for helping!
Amalthia
Amalthia is offline