$ echo " HOW ARE YOU =>FINE How are You=>FINE HOW ARE You=>FINE" | \ perl -ne'print if /\A[[:upper:][:^alpha:]]+\z/' HOW ARE YOU =>FINE