jodd-mail/src/main/java/jodd/mail/RFC2822AddressParser.java
private String getFirstComment(final String text) {
		if (text == null) {
			return null; // important
		}

		final Matcher m = _COMMENT_PATTERN.matcher(text);

		if (!m.find()) {
			return null;
		}

		return m.group().trim();    // must trim
	}
private String getFirstComment(final String text) {
		if (text == null) {
			return null; // important
		}

		final Matcher m = _COMMENT_PATTERN.matcher(text);

		if (!m.find()) {
			return null;
		}

		return m.group().trim();    // must trim
	}
private String getFirstComment ( final String text ) { if ( text == null ) { return null ; // important } final Matcher m = _COMMENT_PATTERN . matcher ( text ) ; if ( ! m . find ( ) ) { return null ; } return m . group ( ) . trim ( ) ; // must trim }
Given a string, extract the first matched comment token as defined in 2822, trimmed;
return null on all errors or non-findings.
<p>
Note for future improvement: if COMMENT_PATTERN could handle nested
comments, then this should be able to as well, but if this method were to be used to
find the CFWS personal name (see boolean option) then such a nested comment would
probably not be the one you were looking for?
Given a string extract the first matched comment token as defined in 2822 trimmed ; return null on all errors or non - findings . <p > Note for future improvement : if COMMENT_PATTERN could handle nested comments then this should be able to as well but if this method were to be used to find the CFWS personal name ( see boolean option ) then such a nested comment would probably not be the one you were looking for?