Fix Android compatibility by using Matcher.group(int) instead of Matcher.group(String)

This commit is contained in:
Paul Schaub 2022-12-20 17:27:32 +01:00
parent 94851ccb8f
commit 75f69c0473
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 3 additions and 3 deletions

View File

@ -92,9 +92,9 @@ public final class UserId implements CharSequence {
string = string.trim();
Matcher matcher = nameAddrPattern.matcher(string);
if (matcher.find()) {
String name = matcher.group("name");
String comment = matcher.group("comment");
String mail = matcher.group("email");
String name = matcher.group(2);
String comment = matcher.group(4);
String mail = matcher.group(6);
matcher = emailPattern.matcher(mail);
if (!matcher.matches()) {
throw new IllegalArgumentException("Malformed email address");