EmailDoCoMoResultParser.java (zxing-zxing-3.4.0) | : | EmailDoCoMoResultParser.java (zxing-zxing-3.4.1) | ||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
public final class EmailDoCoMoResultParser extends AbstractDoCoMoResultParser { | public final class EmailDoCoMoResultParser extends AbstractDoCoMoResultParser { | |||
private static final Pattern ATEXT_ALPHANUMERIC = Pattern.compile("[a-zA-Z0-9@ .!#$%&'*+\\-/=?^_`{|}~]+"); | private static final Pattern ATEXT_ALPHANUMERIC = Pattern.compile("[a-zA-Z0-9@ .!#$%&'*+\\-/=?^_`{|}~]+"); | |||
@Override | @Override | |||
public EmailAddressParsedResult parse(Result result) { | public EmailAddressParsedResult parse(Result result) { | |||
String rawText = getMassagedText(result); | String rawText = getMassagedText(result); | |||
if (!rawText.startsWith("MATMSG:")) { | if (!rawText.startsWith("MATMSG:")) { | |||
return null; | return null; | |||
} | } | |||
String[] tos = matchDoCoMoPrefixedField("TO:", rawText, true); | String[] tos = matchDoCoMoPrefixedField("TO:", rawText); | |||
if (tos == null) { | if (tos == null) { | |||
return null; | return null; | |||
} | } | |||
for (String to : tos) { | for (String to : tos) { | |||
if (!isBasicallyValidEmailAddress(to)) { | if (!isBasicallyValidEmailAddress(to)) { | |||
return null; | return null; | |||
} | } | |||
} | } | |||
String subject = matchSingleDoCoMoPrefixedField("SUB:", rawText, false); | String subject = matchSingleDoCoMoPrefixedField("SUB:", rawText, false); | |||
String body = matchSingleDoCoMoPrefixedField("BODY:", rawText, false); | String body = matchSingleDoCoMoPrefixedField("BODY:", rawText, false); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |