How to check whether a string contains special character in ruby. If I get regular expression also it is fine.
Please let me know
Why not use inverse of [:alnum:] posix.
[:alnum:]
Here [:alnum:] includes all 0-9, a-z, A-Z.
0-9
a-z
A-Z
Read more here.