Match

Checks if the value matches a given regular expression

  • return (boolean)

In your code

if(v::match($value, '/[a-z0-9]+/')) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      match: "/[a-z0-9]+/"

Is something missing or incorrect? Edit this page on Github…