fparser.two.pattern_tools
Tools for constructing patterns.
Permission to use, modify, and distribute this software is given under the terms of the NumPy License. See http://scipy.org.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. Author: Pearu Peterson <pearu@cens.ioc.ee> Created: Oct 2006
Module Contents
Classes
Attributes
- class fparser.two.pattern_tools.Pattern(label, pattern, optional=0, flags=0, value=None)[source]
p1 | p2 -> <p1> | <p2> p1 + p2 -> <p1> <p2> p1 & p2 -> <p1><p2> ~p1 -> [ <p1> ] ~~p1 -> [ <p1> ]... ~~~p1 -> <p1> [ <p1> ]... ~~~~p1 -> ~~~p1 abs(p1) -> whole string match of <p1> p1.named(name) -> match of <p1> has name p1.match(string) -> return string match with <p1> p1.flags(<re.I,..>) p1.rsplit(..) -> split a string from the rightmost p1 occurrence p1.lsplit(..) -> split a string from the leftmost p1 occurrence
- rsplit(string, is_add=False)[source]
Return (<lhs>, <pattern_match>, <rhs>) where:
string = lhs + pattern_match + rhs
and rhs does not contain pattern_match. If no pattern_match is found in string, return None.