This is an automated email from the ASF dual-hosted git repository.
krlawrence pushed a commit to branch TINKERPOP-2652
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/TINKERPOP-2652 by this push:
new 4875795 Add documentation for TextP.regex
4875795 is described below
commit 48757956316d2ba10688d95f6dd668a545e43d00
Author: Kelvin Lawrence <[email protected]>
AuthorDate: Wed Dec 15 12:35:20 2021 -0600
Add documentation for TextP.regex
---
docs/src/reference/the-traversal.asciidoc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/docs/src/reference/the-traversal.asciidoc
b/docs/src/reference/the-traversal.asciidoc
index a775e4b..b45552e 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -3978,7 +3978,8 @@ A `P` is a predicate of the form
`Function<Object,Boolean>`. That is, given some
the release of TinkerPop 3.4.0, Gremlin also supports simple text predicates,
which only work on `String` values. The `TextP`
text predicates extend the `P` predicates, but are specialized in that they
are of the form `Function<String,Boolean>`.
The provided predicates are outlined in the table below and are used in
various steps such as <<has-step,`has()`>>-step,
-<<where-step,`where()`>>-step, <<is-step,`is()`>>-step, etc.
+<<where-step,`where()`>>-step, <<is-step,`is()`>>-step, etc. Two new
additional `TextP` predicate members were added in the
+TinkerPop 3.6.0 release that allow working with regular expressions. These are
`TextP.regex` and `TextP.notRegex`
[width="100%",cols="3,15",options="header"]
|=========================================================
@@ -4000,8 +4001,12 @@ The provided predicates are outlined in the table below
and are used in various
| `TextP.notStartingWith(string)` | Does the incoming `String` not start with
the provided `String`?
| `TextP.notEndingWith(string)` | Does the incoming `String` not end with the
provided `String`?
| `TextP.notContaining(string)` | Does the incoming `String` not contain the
provided `String`?
+| `TextP.regex(string)` | Does the incoming `String` match the regular
expression in the provided `String`?
+| `TextP.notRegex(string)` | Does the incoming `String` fail to match the
regular expression in the provided `String`?
|=========================================================
-
+Note that the TinkerPop reference implementation uses the Java `Pattern` and
`Matcher` classes for it regular expression
+engine. Other implementations may decide to use a different regular expression
engine. It's a good idea to check
+the documentation for the implementation you are using to verify the allowed
regular expression syntax.
[gremlin-groovy]
----
eq(2)