1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-10-31 17:45:58 +01:00

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

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");