import java.util.regex.*; // Make regex classes easily available Pattern r = Pattern.compile("^Subject: (.*)", Pattern.CASE_INSENSITIVE); Matcher m = r.matcher(line); if (m.find()) { subject = m.group(1); } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl