Match match = new Match(); reg.matches(target, match); for (int i = 0; i < match.getNumberOfGroups(); i ++) { if (i == 0 ) System.out.print("Matched range for the whole pattern: "); else System.out.print("["+i+"]: "); if (match.getBeginning(i) < 0) System.out.println("-1"); else { System.out.print(match.getBeginning(i)+", "+match.getEnd(i)+", "); System.out.println("\""+match.getCapturedText(i)+"\"");
if (refno <= 0 || refno >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno); if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) return -1; // ******** int o2 = con.match.getBeginning(refno); int literallen = con.match.getEnd(refno)-o2; if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { int refno = op.getData(); if (con.match != null && refno > 0) { int save = con.match.getBeginning(refno); con.match.setBeginning(refno, offset); int ret = this. matchString (con, op.next, offset, dx, opts); if (ret < 0) con.match.setBeginning(refno, save); return ret; } else if (con.match != null && refno < 0) { int index = -refno; int save = con.match.getEnd(index); con.match.setEnd(index, offset); int ret = this. matchString (con, op.next, offset, dx, opts); if (ret < 0) con.match.setEnd(index, save); return ret; if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
if (refno <= 0 || refno >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno); if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) return -1; // ******** int o2 = con.match.getBeginning(refno); int literallen = con.match.getEnd(refno)-o2; if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { int refno = op.getData(); if (con.match != null && refno > 0) { int save = con.match.getBeginning(refno); con.match.setBeginning(refno, offset); int ret = this. matchCharArray (con, op.next, offset, dx, opts); if (ret < 0) con.match.setBeginning(refno, save); return ret; } else if (con.match != null && refno < 0) { int index = -refno; int save = con.match.getEnd(index); con.match.setEnd(index, offset); int ret = this. matchCharArray (con, op.next, offset, dx, opts); if (ret < 0) con.match.setEnd(index, save); return ret; if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
if (refno <= 0 || refno >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno); if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) return -1; // ******** int o2 = con.match.getBeginning(refno); int literallen = con.match.getEnd(refno)-o2; if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { int refno = op.getData(); if (con.match != null && refno > 0) { int save = con.match.getBeginning(refno); con.match.setBeginning(refno, offset); int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts); if (ret < 0) con.match.setBeginning(refno, save); return ret; } else if (con.match != null && refno < 0) { int index = -refno; int save = con.match.getEnd(index); con.match.setEnd(index, offset); int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts); if (ret < 0) con.match.setEnd(index, save); return ret; if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno); if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) { returned = true; break; int o2 = con.match.getBeginning(refno); int literallen = con.match.getEnd(refno)-o2; if (dx > 0) { if (!target.regionMatches(isSetIgnoreCase, offset, con.limit, o2, literallen)) { if (con.match != null) { if (refno > 0) { dataStack.push(con.match.getBeginning(refno)); con.match.setBeginning(refno, offset); dataStack.push(con.match.getEnd(index)); con.match.setEnd(index, offset); if (con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0) { op = cop.yes; if (retValue < 0) { if (refno > 0) { con.match.setBeginning(refno, saved); con.match.setEnd(-refno, saved);
match.setNumberOfGroups(this.nofparen); match.setSource(target); } else if (this.hasBackReferences) { match = new Match(); match.setNumberOfGroups(this.nofparen); con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); if (o >= 0) { if (con.match != null) { con.match.setBeginning(0, o); con.match.setEnd(0, o+this.fixedString.length()); con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd);
match.setNumberOfGroups(this.nofparen); match.setSource(target); } else if (this.hasBackReferences) { match = new Match(); match.setNumberOfGroups(this.nofparen); con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); if (o >= 0) { if (con.match != null) { con.match.setBeginning(0, o); con.match.setEnd(0, o+this.fixedString.length()); con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd);
match.setNumberOfGroups(this.nofparen); match.setSource(target); } else if (this.hasBackReferences) { match = new Match(); match.setNumberOfGroups(this.nofparen); con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); if (o >= 0) { if (con.match != null) { con.match.setBeginning(0, o); con.match.setEnd(0, o+this.fixedString.length()); con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd);
match.setNumberOfGroups(this.nofparen); match.setSource(target); } else if (this.hasBackReferences) { match = new Match(); match.setNumberOfGroups(this.nofparen); con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); if (o >= 0) { if (con.match != null) { con.match.setBeginning(0, o); con.match.setEnd(0, o+this.fixedString.length()); con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd);
match.setNumberOfGroups(this.nofparen); match.setSource(target); } else if (this.hasBackReferences) { match = new Match(); match.setNumberOfGroups(this.nofparen); con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); if (o >= 0) { if (con.match != null) { con.match.setBeginning(0, o); con.match.setEnd(0, o+this.fixedString.length()); con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd);
match.setNumberOfGroups(this.nofparen); match.setSource(target); } else if (this.hasBackReferences) { match = new Match(); match.setNumberOfGroups(this.nofparen); con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); if (o >= 0) { if (con.match != null) { con.match.setBeginning(0, o); con.match.setEnd(0, o+this.fixedString.length()); con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd);
Match match = new Match(); reg.matches(target, match); for (int i = 0; i < match.getNumberOfGroups(); i ++) { if (i == 0 ) System.out.print("Matched range for the whole pattern: "); else System.out.print("["+i+"]: "); if (match.getBeginning(i) < 0) System.out.println("-1"); else { System.out.print(match.getBeginning(i)+", "+match.getEnd(i)+", "); System.out.println("\""+match.getCapturedText(i)+"\"");
/** * */ public synchronized Object clone() { Match ma = new Match(); if (this.nofgroups > 0) { ma.setNumberOfGroups(this.nofgroups); if (this.ciSource != null) ma.setSource(this.ciSource); if (this.strSource != null) ma.setSource(this.strSource); for (int i = 0; i < this.nofgroups; i ++) { ma.setBeginning(i, this.getBeginning(i)); ma.setEnd(i, this.getEnd(i)); } } return ma; }
/** * */ @Override public synchronized Object clone() { Match ma = new Match(); if (this.nofgroups > 0) { ma.setNumberOfGroups(this.nofgroups); if (this.ciSource != null) ma.setSource(this.ciSource); if (this.strSource != null) ma.setSource(this.strSource); for (int i = 0; i < this.nofgroups; i ++) { ma.setBeginning(i, this.getBeginning(i)); ma.setEnd(i, this.getEnd(i)); } } return ma; }