re
Regular expression matching, searching, and replacement using the Thompson NFA engine.
Import
import reFunctions
re.test(pattern: str, str: str) -> bool
True if pattern matches anywhere in str. Also available as re.is_match(pattern, str).
re.match(pattern: str, str: str) -> str | null
Return the first match as a string, or null if no match.
re.find_all(pattern: str, str: str) -> [str]
Return an array of all non-overlapping matches.
re.replace(pattern: str, str: str, repl: str) -> str
Replace the first match with repl.
re.replace_all(pattern: str, str: str, repl: str) -> str
Replace all matches with repl.
re.split(pattern: str, str: str) -> [str]
Split str by pattern, returning an array of parts.
re.groups(pattern: str, str: str) -> [str]
Return capture groups from the first match as an array.
Examples
scratch.xs