Swat/SwatUriEntry.php
protected function validateUri($value)
    {
        $schemes = array();
        foreach ($this->valid_schemes as $scheme) {
            $schemes[] = preg_quote($scheme, '_');
        }
        $schemes = implode('|', $schemes);

        $regexp =
            '_^
			# scheme
			((' .
            $schemes .
            ')://)
			# user:pass authentication
			(\S+(:\S*)?@)?
			# domain part
			(([a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)
			# zero or more domain parts separated by dots
			(\.([a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*
			# top-level domain part separated by dot
			(\.(?:[a-z\x{00a1}-\x{ffff}]{2,}))
			# port number
			(:\d{2,5})?
			# resource path
			(/[^\s]*)?
			$_iuSx';

        return preg_match($regexp, $value) === 1;
    }
protected function validateUri($value)
    {
        $schemes = array();
        foreach ($this->valid_schemes as $scheme) {
            $schemes[] = preg_quote($scheme, '_');
        }
        $schemes = implode('|', $schemes);

        $regexp =
            '_^
			# scheme
			((' .
            $schemes .
            ')://)
			# user:pass authentication
			(\S+(:\S*)?@)?
			# domain part
			(([a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)
			# zero or more domain parts separated by dots
			(\.([a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*
			# top-level domain part separated by dot
			(\.(?:[a-z\x{00a1}-\x{ffff}]{2,}))
			# port number
			(:\d{2,5})?
			# resource path
			(/[^\s]*)?
			$_iuSx';

        return preg_match($regexp, $value) === 1;
    }
protected function validateUri ( $ value ) { $ schemes = array ( ) ; foreach ( $ this -> valid_schemes as $ scheme ) { $ schemes [ ] = preg_quote ( $ scheme , '_' ) ; } $ schemes = implode ( '|' , $ schemes ) ; $ regexp = '_^
			# scheme
			((' . $ schemes . ')://)
			# user:pass authentication
			(\S+(:\S*)?@)?
			# domain part
			(([a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)
			# zero or more domain parts separated by dots
			(\.([a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*
			# top-level domain part separated by dot
			(\.(?:[a-z\x{00a1}-\x{ffff}]{2,}))
			# port number
			(:\d{2,5})?
			# resource path
			(/[^\s]*)?
			$_iuSx' ; return preg_match ( $ regexp , $ value ) === 1 ; }
Validates a URI

@param string $value the URI to validate.

@return boolean true if <code>$value</code> is a valid URI and
false if it is not.
Validates a URI