API¶
This part of the documentation covers all the interfaces of SRL-Python.
SRL Object¶
srl¶
This module implements Simple Regex Language object.
copyright: |
|
---|---|
license: | MIT, see LICENSE for more details. |
-
class
srl.srl.
SRL
(srl=None)¶ The SRL object implements Simple Regex Language and acts as central object. It is passed the string represented for Simple Regex Language. Once it is created it will act almost exactly same behavior as re.RegexObject.
Usually you create a
SRL
instance like this:from srl import SRL srl = SRL('letter from a to f')
Parameters: srl – the string of Simple Regex Language -
__getattr__
(method)¶ SRL shares the same API with
re.RegexObject
.:>>> srl = SRL('digit exactly 3 times') >>> assert srl.match('012').group(0) == '012'
-
__str__
()¶ str(srl): regex pattern of compiled Simple Regex Language.:
>>> srl = SRL('digit exactly 3 times') >>> assert str(srl) == '[0-9]{3}'
-
srl.builder¶
This module implements the builder of Simple Regex Language.
copyright: |
|
---|---|
license: | MIT, see LICENSE for more details. |
srl.parsers.parser¶
This module implements Simple Regex Language parser.
copyright: |
|
---|---|
license: | MIT, see LICENSE for more details. |