MCPcopy Create free account
hub / github.com/google/re2j / findUTF8Submatch

Method findUTF8Submatch

java/com/google/re2j/RE2.java:680–692  ·  view source on GitHub ↗
(byte[] b)

Source from the content-addressed store, hash-verified

678 */
679 // This is visible for testing.
680 byte[][] findUTF8Submatch(byte[] b) {
681 int[] a = doExecute(MachineInput.fromUTF8(b), 0, UNANCHORED, prog.numCap);
682 if (a == null) {
683 return null;
684 }
685 byte[][] ret = new byte[1 + numSubexp][];
686 for (int i = 0; i < ret.length; i++) {
687 if (2 * i < a.length && a[2 * i] >= 0) {
688 ret[i] = Utils.subarray(b, a[2 * i], a[2 * i + 1]);
689 }
690 }
691 return ret;
692 }
693
694 /**
695 * Returns an array holding the index pairs identifying the leftmost match of this regular

Callers 1

testFindUTF8SubmatchMethod · 0.80

Calls 3

doExecuteMethod · 0.95
fromUTF8Method · 0.95
subarrayMethod · 0.95

Tested by 1

testFindUTF8SubmatchMethod · 0.64