On Thu, 12 Aug 2004 15:32:33 -0600, C.F. Scheidecker Antunes
<[EMAIL PROTECTED]> wrote:
> Hello all,
> 
> I need to check if there are any upper case letters on a given string.
> There can be one or more letters that might be upper case on a given
> string no matter their position within the string.
> 
> Is there any way to check for it?
> 
> obs: I do not want to convert to lowercase, but to check for the
> presence of upper case letters.
> 
> I copuld iterate through the string and evaluate each caracter but I
> wonder if there is a more effective method to achieve that.
> 
> examples:
> 
> uyYmfawelk  = returns true
> YlsngfswU  = returns true
> kjnsdfW      = true
> fwerg;m     = false
> 

if(preg_match('/[A-Z]/', $text)) {
  echo 'Found caps!';
}

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to