Stripped-down version of 'extract()
(txt, begin, end, default="")
| 192 | |
| 193 | |
| 194 | def extr(txt, begin, end, default=""): |
| 195 | """Stripped-down version of 'extract()'""" |
| 196 | try: |
| 197 | first = txt.index(begin) + len(begin) |
| 198 | return txt[first:txt.index(end, first)] |
| 199 | except Exception: |
| 200 | return default |
| 201 | |
| 202 | |
| 203 | def rextract(txt, begin, end, pos=None): |
no outgoing calls
no test coverage detected