equal
deleted
inserted
replaced
226 'listfile', 'listfile0', 'set'): |
226 'listfile', 'listfile0', 'set'): |
227 return kind, pat |
227 return kind, pat |
228 return default, pattern |
228 return default, pattern |
229 |
229 |
230 def _globre(pat): |
230 def _globre(pat): |
231 '''Convert an extended glob string to a regexp string.''' |
231 r'''Convert an extended glob string to a regexp string. |
|
232 |
|
233 >>> print _globre(r'?') |
|
234 . |
|
235 >>> print _globre(r'*') |
|
236 [^/]* |
|
237 >>> print _globre(r'**') |
|
238 .* |
|
239 >>> print _globre(r'[a*?!^][^b][!c]') |
|
240 [a*?!^][\^b][^c] |
|
241 >>> print _globre(r'{a,b}') |
|
242 (?:a|b) |
|
243 >>> print _globre(r'.\*\?') |
|
244 \.\*\? |
|
245 ''' |
232 i, n = 0, len(pat) |
246 i, n = 0, len(pat) |
233 res = '' |
247 res = '' |
234 group = 0 |
248 group = 0 |
235 escape = re.escape |
249 escape = re.escape |
236 def peek(): |
250 def peek(): |