FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: document regular expression function arguments by stantheman0128 · Pull Request #1684 · apache/datafusion-python · GitHub

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
23 changes: 23 additions & 0 deletions python/datafusion/functions/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,11 @@ def regexp_like(
Tests a string using a regular expression returning true if at least one match,
false otherwise.

Args:
string: Data to test against the regular expression.
regex: Regular expression to search for.
flags: Optional regular expression flags to control regex behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
flags: Optional regular expression flags to control regex behavior.
flags: Flags to control regex behavior.

NIT: Optional is implied by the = None


Examples:
>>> ctx = dfn.SessionContext()
>>> df = ctx.from_pydict({"a": ["hello123"]})
Expand Down Expand Up @@ -1797,6 +1802,11 @@ def regexp_match(
Returns an array with each element containing the leftmost-first match of the
corresponding index in ``regex`` to string in ``string``.

Args:
string: Data to match against the regular expression.
regex: Regular expression to search for.
flags: Optional regular expression flags to control regex behavior.

Examples:
>>> ctx = dfn.SessionContext()
>>> df = ctx.from_pydict({"a": ["hello 42 world"]})
Expand Down Expand Up @@ -1839,6 +1849,13 @@ def regexp_replace(
Supported flags with the addition of 'g' can be found at
<https://docs.rs/regex/latest/regex/#grouping-and-flags>

Args:
string: Data to search for the regular expression match.
pattern: Regular expression to search for.
replacement: Text substituted for each match.
flags: Optional regular expression flags to control regex behavior. Add
``g`` to replace every match rather than only the first.

Examples:
>>> ctx = dfn.SessionContext()
>>> df = ctx.from_pydict({"a": ["hello 42"]})
Expand Down Expand Up @@ -1885,6 +1902,12 @@ def regexp_count(
Optional start position (the first position is 1) to search for the regular
expression.

Args:
string: Data to search for the regular expression match.
pattern: Regular expression to search for.
start: Optional position to start the search (the first position is 1).
flags: Optional regular expression flags to control regex behavior.

Examples:
>>> ctx = dfn.SessionContext()
>>> df = ctx.from_pydict({"a": ["abcabc"]})
Expand Down

Back | FazBrowse Home | New Git URL