What is the class \p{Alnum} in the regex of the Ruby language? What characters does it contain, and how does it differ from [:alnum:]?
What is the class \p{Alnum} in the regex of the Ruby language? What characters
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Based on the rdoc and this tutorial, the two expressions are equivalent.
They contain alphabetic and numeric characters. If only using ASCII characters, it is equivalent to
[a-zA-Z0-9]. If there are non-ASCII characters, both[:alnum:]andp{Alnum}would also include things like accented characters.