Match

Checks if the value matches a given regular expression

In your code

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

In panel fields

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