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

Method findAllUTF8Submatch

java/com/google/re2j/RE2.java:859–880  ·  view source on GitHub ↗
(final byte[] b, int n)

Source from the content-addressed store, hash-verified

857 */
858 // This is visible for testing.
859 List<byte[][]> findAllUTF8Submatch(final byte[] b, int n) {
860 final List<byte[][]> result = new ArrayList<byte[][]>();
861 allMatches(
862 MachineInput.fromUTF8(b),
863 n,
864 new DeliverFunc() {
865 @Override
866 public void deliver(int[] match) {
867 byte[][] slice = new byte[match.length / 2][];
868 for (int j = 0; j < slice.length; ++j) {
869 if (match[2 * j] >= 0) {
870 slice[j] = Utils.subarray(b, match[2 * j], match[2 * j + 1]);
871 }
872 }
873 result.add(slice);
874 }
875 });
876 if (result.isEmpty()) {
877 return null;
878 }
879 return result;
880 }
881
882 /**
883 * {@code findAllUTF8SubmatchIndex} is the <a href='#all'>All</a> version of

Callers 1

Calls 3

allMatchesMethod · 0.95
fromUTF8Method · 0.95
isEmptyMethod · 0.80

Tested by 1