Skip to content

Commit

Permalink
docs(api): indicate that re_search need only match part of a string (
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews authored Oct 31, 2024
1 parent c55cbd9 commit 78d88a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ibis/expr/types/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,9 @@ def ilike(
why="Different backends support different regular expression syntax."
)
def re_search(self, pattern: str | StringValue) -> ir.BooleanValue:
"""Return whether the values match `pattern`.
"""Return whether `self` contains the regex `pattern`.
Returns `True` if the regex matches a string and `False` otherwise.
Returns `True` if the regex matches any part of a string and `False` otherwise.
Parameters
----------
Expand All @@ -1038,7 +1038,7 @@ def re_search(self, pattern: str | StringValue) -> ir.BooleanValue:
--------
>>> import ibis
>>> ibis.options.interactive = True
>>> t = ibis.memtable({"s": ["Ibis project", "GitHub"]})
>>> t = ibis.memtable({"s": ["Ibis project", "GitHub", "GitHub Actions"]})
>>> t.s.re_search(".+Hub")
┏━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ RegexSearch(s, '.+Hub') ┃
Expand All @@ -1047,6 +1047,7 @@ def re_search(self, pattern: str | StringValue) -> ir.BooleanValue:
├─────────────────────────┤
│ False │
│ True │
│ True │
└─────────────────────────┘
"""
return ops.RegexSearch(self, pattern).to_expr()
Expand Down

0 comments on commit 78d88a5

Please sign in to comment.