I was going to ask for support, but I just figured out how to solve it.
So for the sake of the missing readme.txt documentation and future searches here you are.

Don't forget to include an opening and closing slash on your Regular expression (Perl-Compatible) validation.
Pattern example for "Only letters, numbers and underscore":
/^[A-Za-z0-9_]+$/

inspired by this great tutorial http://code.tutsplus.com/tutorials/8-regular-expressions-you-should-know--net-6149

Comments

eworwa’s picture

Hi,

Maybe I'm doing something wrong but I cannot see wath is it. I'm trying to set a field validation to get just letters, but I'm just not getting there. I'm using the next regex: '/^[A-Za-z]+$/' (without quotes), but it's simply not working. I have also tried with '^[A-Za-z]+$' (without quotes) as been said here https://www.drupal.org/node/1180064 but it's still not working. Like I've said, maybe it's some stupid stuff I'm not seeing, but I'm stocked here.

Any help would be very appreciated.

cdmo’s picture

Perhaps something changed in the code base since the original solution, but you need to specifically *not use* slashes at the beginning and end. This validation is using a php function called mb_ereg or mb_eregi. This PHP by Example site has a good way to understand and test this function.

prasanna_drupal’s picture

Dear eworwa,
Try the expression with out single quotes like /^[A-Za-z]+$/
It is working, Tested the same.