I want to parse a path string with multiple files and try to figure out a
one-line way.

If I have path: /home/admin/hello/yo/{h1,h2,h3,h4}

What I thought is use regex.search, but the pattern always failed.

I use below:
import re
path = /home/admin/hello/yo/{h1,h2,h3,h4}
r = re.search('{.}', path)
# r should be ['h1,h2,h3,h4'] but I fail

Why always search nothing?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to