Including a test for a whitespace in addition to other tests in a perl pattern match

Viewed 52

I want to search a given string for accented or weird symbolic characters which occur when exporting/importing between MySQL and Excel when using a tab separated text file.

To do this i have tried !~ /[a-zA-Z0-9]\s/ - i thought this pattern would test a given string and identify those that contained anything other than a-z, A-Z, 0-9 or a white space?

When putting this into a regex tester on line the \s works on its own but when i add the a-zA-Z0-9 element it cancels out the white space.

The white space could be all that is contained in the string or it could be at the beginning or end, what is the correct regex to capture this please?

1 Answers
Related