StringParser
A convenience class that makes it easy to pull blocks out of strings and whatnot
Properties and Methods
MatchIterator: type
get_regex_block_handlers: method
get_regex_dtypes: method
handler_method: method
to_array: method
array_handler: method
__init__(self, regex):
parse(self, txt, regex=None, block_handlers=None, dtypes=None, out=None):
Finds a single match for the and applies parsers for the specified regex in txt
txt:stra chunk of text to be matched
regex:RegexPatternthe regex to match in txt
block_handlers:iterable[callable] | OrderedDict[str: callable]handlers for the matched blocks in regex – usually comes from regex
dtypes:iterable[type | StructuredType] | OrderedDict[str: type | StructuredType]the types of the data that we expect to match – usually comes from regex
out:None | StructuredTypeArray | iterable[StructuredTypeArray] | OrderedDict[str: StructuredTypeArray]where to place the parsed out data – usually comes from regex
:returns:_No description…
parse_all(self, txt, regex=None, num_results=None, block_handlers=None, dtypes=None, out=None):
parse_iter(self, txt, regex=None, num_results=None, block_handlers=None, dtypes=None):
load_array(data, dtype='float'):
Examples
Edit Examples or
Create New Examples
Edit Template or
Create New Template
Edit Docstrings