-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Parsing problem with '=?UTF-8?Q?Gesellschaft_f=C3=BCr_Freiheitsrechte_e=2EV=2E?= <info@freiheitsrechte.org>' #18
Comments
That address looks valid to me... maybe @bbottema will have a comment about why it isn't working. |
I double checked and this address indeed doesn't pass the test. I have not clue why, somewhere the following awesomeballz regex fails to recognize this address as valid:
😃 |
It validates with the default So one of the following flags makes it fail:
|
Ok, so ALLOW_SQUARE_BRACKETS_IN_A_TEXT breaks the validation. However, the intricate details of these regexes are beyond my knowledge. I don't understand what brackets have to do with this particular email address. |
This line has It's been ages since I was in this stuff, so just taking shots here. :-) |
Yeah I was just testing that myself, but doesn't seem to matter. |
Hmmm... seems like an uncommented ] there would really throw a wrench in... I'm surprised it didn't matter... |
Yeah, maybe the regex engine is smart enough to look for an outer bracket of character ranges. Anyway I escaped it now and committed it as well as this particular case as a junit test, which as of now breaks the build. Perhaps you can have a look, it's ninny time for me! Oh and I'm pulling the parent card again; a month ago I became father for the second time 😄😄 |
Congrats! For when you return -- how about the line before -- shouldn't that dot be escaped? |
No, as it is already inside a character range (ie. |
Ok, I just found out it's not so much that the presence of After zooming in on this, I found that leaving Unfortunately, the if (criteria.contains(EmailAddressCriteria.ALLOW_QUOTED_IDENTIFIERS)) {
(..) // no problems in this case
} else {
// somewhere the following code breaks our use case
// no quoted identifiers, yes|no domain literals
local_part_da = m.group(3);
if (local_part_da == null) {
local_part_qs = m.group(4);
}
domain_part_da = m.group(5);
if (domain_part_da == null && allowDomainLiterals) {
domain_part_dl = m.group(6);
}
current_localpart = local_part_da == null ? local_part_qs : local_part_da;
current_domainpart = domain_part_da == null ? domain_part_dl : domain_part_da;
if (extractCfwsPersonalNames) {
personal_string = m.group((allowDomainLiterals ? 1 : 0) + 6);
personal_string = removeAnyBounding('(', ')', getFirstComment(personal_string, criteria));
}
} |
Ok last one from me... on this line, should the ^ be Anyway sounds like you've traced the issue elsewhere, just thought I'd check. |
From regular-expressions.info on Character Classes or Character Sets:
So that's fine. |
Righto. Good luck with the bug! |
I tried the library on many mail addresses without problems but
=?UTF-8?Q?Gesellschaft_f=C3=BCr_Freiheitsrechte_e=2EV=2E?= <info@freiheitsrechte.org>
seems to confuseEmailAddressParser
. I have no if it is valid w.r.t. rfc2822, however..The text was updated successfully, but these errors were encountered: