Regex to remove special characters
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi community Happy new year,
I'm not to good with RegEx but I know it is needed in my use case. I have these company names but they contain special characters and i'm not sure how to remove them. I've attached a mini dummy sample of the data below.
Any assistance with this would be majorly appreciated
Name |
Test Company 1 –Limited |
Test Company 2’s Ltd |
O’Test Hotel Limited |
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try REGEX_Replace([String],"[^a-z,A-Z,0-9,\s]","")
This gets rid of all characters that are not special letters, spaces or numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@binuacs I saw your solution and I'm just wondering how does your Regex work? 😀
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Deano478the regex formula
REGEX_Replace([Name], '[^ -~]', '')
Remove any characters from the incoming field that are outside of the range of ASCII values from "space" to "~".
^ - represent the not operator
<space> - ~ characters with in the range space and ~
Below is the ASCII table where you can see the range 32(space) - 126(~), so any characters that fall other than this range will get replaced with ''
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@binuacs that's actually very interesting to read I will definitely read more into regex to get more comfortable with it myself it seems very powerful when used the right way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hello, i like this solution but i want to apply it in a text field that contains text in japanese, chinese and korean. How can i address that as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@malcorr If you want to include the Japanese, Chinese, and Korean then find their corresponding ASCII characters and include those also in the regex expression, if you can provide some samples I can help you with this.
