Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I need to validate that a field does not contain only numbers. in other words it can have some numbers but must have some letters as well. Can someone help me with the regex to do that? thanks
Comments
Comment #1
dianacastillo CreditAttribution: dianacastillo commentedSomeone gave me the answer on drupal stackexhange so I thought I would share it:
2 down vote accept
Here are the steps you'll need to follow:
Go to your webform
Select the "form validation" button.
under the "Add a validation rule" select "Regular expression, case-sensitive"
For the regex, you can use ^\d*$ and check the negate rule box below
OR
Go to your webform
Select the "form validation" button.
under the "Add a validation rule" select "Regular expression, case-sensitive"
For the regex, you can use [^\d]+
Comment #2
dianacastillo CreditAttribution: dianacastillo commented