/** * Matches only cells with values that satisfy the given <a * href="https://github.com/google/re2/wiki/Syntax">RE2 regex</a>. Note that, since cell values * can contain arbitrary bytes, the `\C` escape sequence must be used if a true wildcard is * desired. The `.` character will not match the new line character `\n`, which may be present * in a binary value. */ public Filter regex(@Nonnull ByteString regex) { Preconditions.checkNotNull(regex); return new SimpleFilter(RowFilter.newBuilder().setValueRegexFilter(regex).build()); }
@Test public void valueExactMatch() { RowFilter actualFilter = FILTERS.value().exactMatch(ByteString.copyFromUtf8("some[0-9]regex")).toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setValueRegexFilter(ByteString.copyFromUtf8("some\\[0\\-9\\]regex")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }
@Test public void valueExactStringMatch() { RowFilter actualFilter = FILTERS.value().exactMatch("some[0-9]regex").toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setValueRegexFilter(ByteString.copyFromUtf8("some\\[0\\-9\\]regex")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }
setValueRegexFilter(other.getValueRegexFilter()); break;
setValueRegexFilter(other.getValueRegexFilter()); break;
/** * Matches only cells with values that satisfy the given <a * href="https://github.com/google/re2/wiki/Syntax">RE2 regex</a>. Note that, since cell values * can contain arbitrary bytes, the `\C` escape sequence must be used if a true wildcard is * desired. The `.` character will not match the new line character `\n`, which may be present * in a binary value. */ public Filter regex(@Nonnull ByteString regex) { Preconditions.checkNotNull(regex); return new SimpleFilter(RowFilter.newBuilder().setValueRegexFilter(regex).build()); }
/** * Matches only cells with values that satisfy the given <a * href="https://github.com/google/re2/wiki/Syntax">RE2 regex</a>. Note that, since cell values * can contain arbitrary bytes, the `\C` escape sequence must be used if a true wildcard is * desired. The `.` character will not match the new line character `\n`, which may be present * in a binary value. */ public Filter regex(@Nonnull ByteString regex) { Preconditions.checkNotNull(regex); return new SimpleFilter(RowFilter.newBuilder().setValueRegexFilter(regex).build()); }
setValueRegexFilter(other.getValueRegexFilter()); break;
@Test public void valueRegex() { RowFilter actualFilter = FILTERS.value().regex("some[0-9]regex").toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setValueRegexFilter(ByteString.copyFromUtf8("some[0-9]regex")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }