concrete/src/Utility/Service/Validation/Strings.php
public function alphanum($value, $allowSpaces = false, $allowDashes = false)
    {
        $allowedCharsRegex = 'A-Za-z0-9';
        if ($allowSpaces) {
            $allowedCharsRegex .= ' ';
        }
        if ($allowDashes) {
            $allowedCharsRegex .= '\-';
        }

        return $this->notempty($value) && !preg_match('/[^' . $allowedCharsRegex . ']/', $value);
    }
public function alphanum($value, $allowSpaces = false, $allowDashes = false)
    {
        $allowedCharsRegex = 'A-Za-z0-9';
        if ($allowSpaces) {
            $allowedCharsRegex .= ' ';
        }
        if ($allowDashes) {
            $allowedCharsRegex .= '\-';
        }

        return $this->notempty($value) && !preg_match('/[^' . $allowedCharsRegex . ']/', $value);
    }
public function alphanum ( $ value , $ allowSpaces = false , $ allowDashes = false ) { $ allowedCharsRegex = 'A-Za-z0-9' ; if ( $ allowSpaces ) { $ allowedCharsRegex .= ' ' ; } if ( $ allowDashes ) { $ allowedCharsRegex .= '\-' ; } return $ this -> notempty ( $ value ) && ! preg_match ( '/[^' . $ allowedCharsRegex . ']/' , $ value ) ; }
Returns true on whether the passed string is completely alpha-numeric, if the value is not a string or is an
empty string false will be returned.

@param string $value
@param bool $allowSpaces whether or not spaces are permitted in the field contents
@param bool $allowDashes whether or not dashes (-) are permitted in the field contents

@return bool
Returns true on whether the passed string is completely alpha - numeric if the value is not a string or is an empty string false will be returned .