I\'m currently trying to make a regex to remove every of those character [0-9] \\ - * \\\' if they are either at the beginning of the string, end of the string or if they are co
You might use an alternation and a character class listing all the characters that you want to remove at the start of the string, the end or repeated 2 or more times using {2,}
^[ *'0-9?&_$-]+|[ *'0-9?&_$-]+$|[ *'0-9?&_$-]{2,}
Regex demo
If you want to remove all except characters a-zA-Z and a negated character class to match any character not in the character class
In the replacement use an empty string.
^[^a-zA-Z]+|[^a-zA-Z]+$|[^a-zA-Z]{2,}
Regex demo