[WordPress] Occasionally, I've been parsing out data provided to me by third-parties and there have been hidden ASCII characters that can muck up programmatically inserting data into the database. Here's a simple regex for stripping out everything *except* alphanumeric characters.
This comment has been minimized.
This comment has been minimized.
You should really fix the parser and leave the file content as it is. |
This comment has been minimized.
This comment has been minimized.
@KingYes: You're right - international characters shouldn't be ignored - but this particular regex was for a very simple, narrowly defined text file. @Tascho: The thing is, I'm not sold that the file content being handed over was accurate. |
This comment has been minimized.
This comment has been minimized.
For those who are looking for a WordPress-based solution (which is what this particular gist was used for), there's a nice function that someone mentioned in this comment. Specifically, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
And what's about Hebrew chars? or maybe Arabic, etc... ?