I search for hours but i can't find the correct regulare expression to match a simple pattern. With this text (it's the stdout of a logical volume by Volume group's listing):
rootvg:
hd5 boot 1 1 1 closed/syncd N/A
hd4 jfs 38 38 1 open/syncd /
datavg:
data01lv jfs 7 7 1 open/syncd /data1
data02lv jfs 7 7 1 open/syncd /data2
I wish to find that kind of results from my regulare expression (with regex.findall(text), for exemple):
[(u'rootvg', u'hd5 boot 1 1 1 closed/syncd N/A\nhd4 jfs 38 38 1 open/syncd /\n'),(u'datavg', u'data01lv jfs 7 7 1 open/syncd /data1\ndata02lv jfs 7 7 1 open/syncd /data2')]
But the best i can have is with this pattern:^(?P<vgname>\w+):\s(?P<lv>[\w\s\.\_\/-]+)+
results with findall:
[(u'rootvg', u'hd5 boot 1 1 1 closed/syncd N/A\nhd4 jfs 38 38 1 open/syncd /\ndatavg')]