In case anyone else finds this when searching for a solution: Create a file named "linkmod.sh" containing:
#!/bin/sh
PATTERN1=`echo "$2"`
PATTERN2=`echo "$3"`
LINKNAME=`echo "$1"`
OLDTARGET=`readlink "$1"`
NEWTARGET=`echo "$OLDTARGET" \
| sed -e 's/'"$PATTERN1"'/'"$PATTERN2"'/'`
echo ln -nsf "$NEWTARGET" "$LINKNAME"
and run
find . -type l -print0 | xargs -0IX echo linkmod.sh X "pattern1" "pattern2"
You can ofc use the -lname option in find if needed.
NOTE: you have to use 2x \ in the patterns before any characters that require \ in sed, since echo removes one. For example
find . -type l -print0 | xargs -0IX echo linkmod.sh X "folder\\ name\\/file" "folder2\\ name\\/file"
Remove the echoecho
from the last line if the ln commands are correct.