Custom Regex pattern

Custom Regex pattern

My question is how do a custom Regex.
This one below works ok, it stops "every" special characters.

regex:"^[a-öA-Ö'.\s]{1,40}$",

But supposte I do want to allow some of the special characters, in my case
I want to allow - and space.

Is there some application maybe on the internet to just put in exactly every charachters you want to dissallow, like building a custom regex pattern?
Any guides would be great here, I don´t know about construction of regex patterns.

/ Cheers