The following characters in your expression are reserved in Regex and require a preceding \ to escape them :
If you write your expression as:
you should see the results you expect.
Hope that helps!
1 of 1 people found this helpful
Here are a couple of thoughts:
In the specific regular expression you had above, I believe the correct expression would be [#,%,\-\-,!,\\,\-\-\-\-\-\-,&]
That escapes all the - and \ characters.
2. One other thing you might consider is whether there are some built in features of Tableau Prep that would meet your goals without having to use regex. For example, you might be able to use the Clean functions on the field to remove unwanted characters:
Now, it may be that it doesn't quite meet your needs. It may remove characters you want to keep or not replace with a space or other character you want to use. And regex may be the best approach. There may be other approaches. It's very difficult to know without understanding your exact goals and if this response doesn't give you the specifics you need to solve your issue, it would be very helpful if you would give more sample data and explain exactly how you want the transformed data.
Hope this helps!