pyxx.strings#
Code for processing, parsing, and modifying strings
The pyxx.strings module is intended to assist with processing data
in the form of Python strings. Submodules provide functionality such as
analyzing strings with parentheses (e.g., determining which parentheses in
a string are “matched” with each other), assisting with string indexing
and splitting, and checking string content.
Analyzing String Content#
The functions in this section can be used to analyze string content, checking whether certain characters or patterns are present or whether the string content has a particular structure.
|
Checks that a string does not contain any of a specified list of prohibited characters |
|
Checks that a string contains only characters present in a specified set of characters |
Bracket Parsing#
The objects in this section are intended to assist in processing strings with
brackets, loosely defined as pairs of characters that enclose quantities of
interest ((), [], {}, etc.). Particularly in scientific contexts,
it can be useful to parse strings containing brackets and identify pairs of
matched brackets.
Note
For more information on terminology definitions and how the functions in this section operate on a conceptual level, refer to the Bracket Concepts page.
|
Checks whether all opening brackets in a string have a corresponding closing bracket |
|
Finds the index of the bracket that forms a matched pair with another bracket at a given index |
|
Finds the index of a target character, skipping over matched brackets |
|
Remove matched leading/trailing brackets from strings |
Splitting Strings#
The functions in this section can be used to analyze strings and split them into sub-strings or lists of strings.
|
Splits a string at a given index |