package L1;

import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

/* JADX INFO: loaded from: classes2.dex */
public abstract class n extends K1.k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private Pattern f1362a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private MatchResult f1363b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    protected Matcher f1364c;

    public n(String str) {
        e(str, 0);
    }

    private void e(String str, int i2) {
        try {
            this.f1362a = Pattern.compile(str, i2);
        } catch (PatternSyntaxException unused) {
            throw new IllegalArgumentException("Unparseable regex supplied: " + str);
        }
    }

    public String f(int i2) {
        MatchResult matchResult = this.f1363b;
        if (matchResult == null) {
            return null;
        }
        return matchResult.group(i2);
    }

    public boolean g(String str) {
        this.f1363b = null;
        Matcher matcher = this.f1362a.matcher(str);
        this.f1364c = matcher;
        if (matcher.matches()) {
            this.f1363b = this.f1364c.toMatchResult();
        }
        return this.f1363b != null;
    }

    public boolean h(String str) {
        e(str, 0);
        return true;
    }

    public n(String str, int i2) {
        e(str, i2);
    }
}
