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

Method findAllIndex

java/com/google/re2j/RE2.java:833–848  ·  view source on GitHub ↗
(String s, int n)

Source from the content-addressed store, hash-verified

831 */
832 // This is visible for testing.
833 List<int[]> findAllIndex(String s, int n) {
834 final List<int[]> result = new ArrayList<int[]>();
835 allMatches(
836 MachineInput.fromUTF16(s),
837 n,
838 new DeliverFunc() {
839 @Override
840 public void deliver(int[] match) {
841 result.add(Utils.subarray(match, 0, 2));
842 }
843 });
844 if (result.isEmpty()) {
845 return null;
846 }
847 return result;
848 }
849
850 /**
851 * {@code findAllUTF8Submatch} is the <a href='#all'>All</a> version of {@link #findUTF8Submatch};

Callers 1

testFindAllIndexMethod · 0.80

Calls 3

allMatchesMethod · 0.95
fromUTF16Method · 0.95
isEmptyMethod · 0.80

Tested by 1

testFindAllIndexMethod · 0.64