Regular Expressions 101

Community Patterns

lsblk-output-regex

1

Regular Expression
Golang

`
(?m)^NAME="(?P<name>(?P<disk>[a-z]+)(?P<partition>\d*))"\sFSTYPE="(?P<fstype>\w*)"\sMOUNTPOINT="(?P<mountpoint>[\w\[\]/]*)"\sSIZE="(?P<size>\d*)"\sTYPE="(?P<type>\w+)"$
`
gm

Description

Trying to adapt this regex to support LVM.

Submitted by anonymous - 3 years ago