(regex, text, group_index=0, flags=0)
| 237 | |
| 238 | |
| 239 | def _search(regex, text, group_index=0, flags=0): |
| 240 | # type: (str, str, int, int) -> Optional[str] |
| 241 | if not text: |
| 242 | if DEBUG: |
| 243 | log.debug("No text to _search()") |
| 244 | return None |
| 245 | |
| 246 | match = re.search(regex, text, flags) |
| 247 | if match: |
| 248 | return match.groups()[group_index] |
| 249 | |
| 250 | return None |
| 251 | |
| 252 | |
| 253 | def _popen(command, args): |