# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/(?:\s*?NAME\s*?:\s*?\"?)([0-9A-Za-z- ,]+)(?:\"?\s*?,\s*?)(?:DESCR\s*?:\s*\"?)([0-9A-Za-z- ,\/+:]+)(?:\"?\s*?PID\s*?:\s*?)([0-9A-Z-]+)(?:\s*?,\s*?VID\s*?:\s*?)([0-9A-Z\/]+)(?:\s*?,\s*?SN\s*?:\s*?)([0-9A-Z\/]+)//gm;t' <<< "NAME: \"Chassis\", DESCR: \"Nexus C9348GC-FXP chassis\"
PID: N9K-C9348GC-FXP , VID: V01 , SN: FFFFFFFFFFF
NAME: \"Slot 1 \", DESCR: \"48x100M/1G \"
PID: N9K-C9348GC-FXP , VID: V01 , SN: FFFFFFFFFFF
NAME: \"GEM \", DESCR: \"4x25G+2x100G Switch \"
PID: N9K-C9348GC-FXP , VID: V01 , SN: FFFFFFFFFFF
NAME: \"power Supply 1\", DESCR: \"PSU \"
PID: NXA-PAC-350W-PE , VID: V01 , SN: DDDDDDDDDDD
NAME: \"power Supply 2\", DESCR: \"PSU \"
PID: NXA-PAC-350W-PE , VID: V01 , SN: DDDDDDDDDDD
NAME: \"Fan 1 \", DESCR: \"fan \"
PID: NXA-FAN-30CFM-F , VID: N/A , SN: N/A
NAME: \"Fan 2 \", DESCR: \"fan \"
PID: NXA-FAN-30CFM-F , VID: N/A , SN: N/A
NAME: \"Fan 3 \", DESCR: \"fan \"
PID: NXA-FAN-30CFM-F , VID: N/A , SN: N/A"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html