Quote:
Originally Posted by JimmXinu
First, you were told before about using sort_ships:true so you only have one order for each to worry about (although sort_ships only works on '/' separated ships.)
We use regular expressions exactly because they can be used to match many different strings. For example, your previous example can be reduced several ways. Here's one:
Code:
## replace pairings with het or slash as you prefer.
add_to_replace_metadata:
pairing=>Arthur[/,&]Merlin=>slash
pairing=>Merlin[/,&]Arthur=>slash
pairing=>John( Watson)?/Sherlock( Holmes)?=>slash
[/,&] will match any one of ' /' ' ,' or ' &'.
( Watson)? groups ' Watson' and the ? indicates it can be present or absent.
Regular expressions are very powerful, but complex. If you want to get the best benefit, you should read up on them a bit. Search for something like:
https://www.google.com/search?q=regu...+for+beginners
|
I don't understand ALL of it yet but I found a better way to get all the different forms for one and the same pairing in one line. Because sometimes you have too many different forms for the same pairing, like
Rodney M./John S.
Rodney McKay & John Sheppard
John, Rodney
This line doesn't care if Rodney or John is namend first and what is in between the two names.
Quote:
add_to_replace_metadata:
pairing=>^(?=.*\bRodney\b)(?=.*\bJohn).*$=>slash
|
Only got a bit tricky with DiNozzo from NCIS because he is sometimes named Anthony or Tony. For him I use this line.
Quote:
|
pairing=>^(?=.*\b.*ony\b)(?=.*\bZiva).*$=>het
|
Works like a charm
I also found a good side to test regular expressions
here
Mini