Translate a shell PATTERN to a regular expression. There is no way to quote meta-characters.
(pat)
| 93 | |
| 94 | |
| 95 | def translate(pat): |
| 96 | """Translate a shell PATTERN to a regular expression. |
| 97 | |
| 98 | There is no way to quote meta-characters. |
| 99 | """ |
| 100 | |
| 101 | parts, star_indices = _translate(pat, '*', '.') |
| 102 | return _join_translated_parts(parts, star_indices) |
| 103 | |
| 104 | |
| 105 | _re_setops_sub = re.compile(r'([&~|])').sub |
searching dependent graphs…