Quote:
Originally Posted by Tanjamuse
How do I swap persons in a relationship
|
The literal answer to your question, ie how to reverse a two person ship (without regard to content) with possible separators '\', '/' or '§', while preserving separator whitespace is surprisingly complicated to get right:
Code:
add_to_replace_metadata:
ships=>^(.+?)([ ]*[§/\\][ ]*)(.+)$=>\3\2\1
# note that \ must be escaped to \\ in the regex part.
If you only want to change those specific ships, the most straightforward way is to just do those exact strings:
Code:
add_to_replace_metadata:
ships=>Jack Sparrow § Elizabeth Swann=>Elizabeth Swann § Jack Sparrow
ships=>Will Turner/Elizabeth Swann=>Elizabeth Swann/Will Turner
However, if what you
really want is all your ships sorted alphabetically (even when more than two), while preserving the separator character and normalizing separator spacing, you can add turn on
sort_ships the '§' separator to
sort_ships_splits.
Code:
sort_ships:true
## default sort_ships_splits already does \ and &, but it removes spaces around /
sort_ships_splits:
[ ]*/[ ]*=>\s/\s
[ ]*&[ ]*=>\s&\s
[ ]*§[ ]*=>\s§\s
[ ]*\\[ ]*=>\s\\s
Two caveats:
- With Win10 CLI, putting '§' in personal.ini caused an error reading the config file.
- As I recall, ships with more than 2 names
and different separators may cause undefined ordering.