Tribe__Validate::alpha_numeric_with_dashes_and_underscores()
Validates a field as a string containing only letters, numbers, dashes and underscores
Source
File: src/Tribe/Validate.php
public function alpha_numeric_with_dashes_and_underscores() {
$this->value = trim( $this->value );
if ( preg_match( '/^[a-zA-Z0-9_-]+$/', $this->value ) ) {
$this->result->valid = true;
} else {
$this->result->valid = false;
$this->result->error = sprintf( esc_html__( '%s must contain numbers, letters, dashes and undescores only', 'tribe-common' ), $this->label );
}
}