I want to check the illegal character and then output the field?
- 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
I have one filed is free-text field ,I want to confirm if the field include illegal character?
except abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 [] {} # () ! ? , . % + @ $ & * : = ^ _ ;"/\-' ><? Space;
others we think they are illegal characters?
how can we to get the result??
- Labels:
- Trifacta Classic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One way you can do this is via Regex extraction. Use the "Extract Patterns" transformation, under "Column to extract from" select the column that contains the free-text field, and provide a piece of regex under "Text to Extract"
Here's a regex that you can try, I believe it should contain all of the characters that you want to keep, and pick out the illegal characters that aren't in the range of characters you supplied:
/[^\w !@#$%^&*()=+?,.:;"'<>\{\}\[\]\-\/\\]/
This means that the newly-created column will contain either one of the illegal characters in the field, or "null" if there are no illegal characters. You can do other steps like transform this column so that it contains more understandable values. Here's an example using the "Edit with formula" transformation:
While it is possible to directly create a column that says "true" or "false" to whether the free-form field contains illegal characters, I personally prefer to break this process up into two steps and use some sample data to verify that my regex is correctly picking out the illegal characters.
