Note
Functions for string parsing.
Module author: Adam Gagorik <adam.gagorik@gmail.com>
Get numbers in a string at index and convert them.
Parameters: |
---|
>>> print lm.regex.number('asdfasdfa1.231e10')
12310000000.0
Find all numbers in a string and convert them.
Parameters: |
---|
>>> print lm.regex.numbers('asdfasdfa1.231e10asdf1209asd asd0912 sdaf9 81')
[12310000000.0, 1209.0, 912.0, 9.0, 81.0]
Return string will all comments stripped.
Parameters: | string (str) – string |
---|
>>> print lm.regex.strip_comments('hello # goodbye')
hello
Return string with true/false in correct python format.
Parameters: | string (str) – string |
---|
>>> print lm.regex.fix_boolean('true false True False true false')
True False True False True False