Quote:
Originally Posted by MiniMouse
 Is there a way to more simplify the following?
|
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