Active
Project:
Field Validation
Version:
7.x-2.4
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2014 at 10:07 UTC
Updated:
20 Nov 2019 at 13:15 UTC
Jump to comment: Most recent
Comments
Comment #1
eworwa commentedHi,
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.
Comment #2
cdmo commentedPerhaps 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_eregormb_eregi. This PHP by Example site has a good way to understand and test this function.Comment #3
prasanna_drupal commentedDear eworwa,
Try the expression with out single quotes like /^[A-Za-z]+$/
It is working, Tested the same.