I have this line of code:
hdfs_regex = re.compile(r'\s+(?P<unmatched>\d+)\s+\/\s+(?P<total>\d+)')
I run through a file and use:
results = re.search(hdfs_regex, line)
to look for the portion in the line that matches my regex. Upon match, is there a way to return each found matched regex variable?
Is there away to return ever found group without knowing the regex variable name?
Pseudocode would might look something like this
grouped_val = [i for i in results.grouped()]
where results.grouped() is an iterable that I can use to retrieve the found value without knowing the variable name