Try something like this

@data = ("FAMILY PLANNING / REPRODUCTIVE HEALTH POLICY", "PUBLIC HEALTH",
"Renewed Hope for the World's Children");

foreach $value(@data) {
        print "$value\n" unless $value =~ /[a-z]+/;
}

Note. This will match anything it finds, unless there is a lowercase letter
in the data. You could make it more complex and search for only caps, spaces
and forward slashes, but as long as you are confident of your data source
then this should do.

HTH

John

-----Original Message-----
From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]]
Sent: 23 July 2001 14:49
To: <
Subject: Need regex to match all UPPERCASE letters?


I need help writing a regular expression that will match lines that have
only upper case letters, and sometimes slashes and spaces, but won't match
lines with mixed case.

Lines that must be matched are like:
FAMILY PLANNING / REPRODUCTIVE HEALTH POLICY
FAMILY PLANNING / REPRODUCTIVE HEALTH PROJECTS
PUBLIC HEALTH
HIV/AIDS

Lines that must NOT be matched include:
Renewed Hope for the World's Children
http://www.earthtimes.org/jul/childrenrenewedhopejul12_01.htm 
AIDS, TB, and Malnutrition Are Triple Threat in Haiti

Any suggestions are welcomed. Thank you for helping me with my problem.

-Kevin Zembower

-----
E. Kevin Zembower
Unix Administrator
Johns Hopkins University/Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD  21202
410-659-6139


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to