regex help using repreated groups
- by Chris H
I'm trying to match rc-update -s output in python.
m = re.match(r"^\s*(\w+)\s*\|{\s*(\w+)\s*}*$", " network | level1 level2 leveln ")
but m is always None
the hard part for me is getting the regex to match the n levels. I thought that using {}* would match the n levels, but as soon as I add the {} nothing matches.
thanks.