I'm trying to remove all characters from a string except for #
, @
, :)
, :(
.
Example:
this is, a placeholder text. I wanna remove symbols like ! and ? but keep @ & # & :)
should result in (after removing the matched results):
this is a placeholder text I wanna remove symbols like and but keep @ # :)
I tried:
(?! |#|@|:\)|:\()\W
It is working but in the case of :)
and :(
, :
is still being matched.
I know that it's matching because it's checking every character and the previous ones, e.g: :)
matches only :
but :))
matches :)
.