re = /^Cisco Catalyst.*AC Power Supply$/m
str = 'Cisco Catalyst 9500 Series Chassis
Cisco Catalyst 9500 Series Power Supply Bay Module Container
Cisco Catalyst 9500 Series Power Supply Bay Module Container
Cisco Catalyst 9500 Series Fan Tray Bay Module Container
Cisco Catalyst 9500 Series 650W AC Power Supply
Cisco Catalyst 9500 Series Power Supply
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series 650W AC Power Supply
Cisco Catalyst 9500 Series Power Supply
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan Tray
Cisco Catalyst 9500 Series Fan Tray
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Fan
Cisco Catalyst 9500 Series Router
PSOC-MB_0: VOU
PSOC-MB_1: VOU
PSOC-MB_2: VOU
PSOC-MB_3: VOU
PSOC-MB_4: VOU
PSOC-MB_5: VOU
PSOC-MB_7: VOU
PSOC-MB_8: VOU
PSOC-MB_9: VOU
PSOC-MB_10: VO
3570MB1_0: VOU
3570MB2_0: VOU
3570MB3_0: VOU
35215MB1_0: VO
35215MB2_0: VO
Temp: Outlet_A
Temp: Outlet_B
Temp: Inlet_A
Temp: Inlet_B
Temp: UADP_0_0
Temp: UADP_0_1
Temp: UADP_0_2
Temp: UADP_0_3
Temp: UADP_0_4
Temp: UADP_0_5
Temp: UADP_0_6
Temp: UADP_0_7
Temp: UADP_0_8
PSOC-DB_1: VOU
PSOC-DB_2: VOU
PSOC-DB_4: VOU
PSOC-DB_5: VOU
PSOC-DB_7: VOU
PSOC-DB_8: VOU
PSOC-DB_11: VO
3570DB1_0: VOU
3570DB2_0: VOU
3570DB3_0: VOU
Temp: Coretemp
Temp: OutletDB
Intel CPU x86-64
USB Port
TwentyFiveGigE1/0/1 Container
TwentyFiveGigE1/0/2 Container
TwentyFiveGigE1/0/3 Container
TwentyFiveGigE1/0/4 Container
TwentyFiveGigE1/0/5 Container
TwentyFiveGigE1/0/6 Container
TwentyFiveGigE1/0/7 Container
TwentyFiveGigE1/0/8 Container
TwentyFiveGigE1/0/9 Container
TwentyFiveGigE1/0/10 Container
TwentyFiveGigE1/0/11 Container
TwentyFiveGigE1/0/12 Container
TwentyFiveGigE1/0/13 Container
TwentyFiveGigE1/0/14 Container
TwentyFiveGigE1/0/15 Container
TwentyFiveGigE1/0/16 Container
TwentyFiveGigE1/0/17 Container
TwentyFiveGigE1/0/18 Container
TwentyFiveGigE1/0/19 Container
TwentyFiveGigE1/0/20 Container
TwentyFiveGigE1/0/21 Container
TwentyFiveGigE1/0/22 Container
TwentyFiveGigE1/0/23 Container
TwentyFiveGigE1/0/24 Container
HundredGigE1/0/25 Container
HundredGigE1/0/26 Container
HundredGigE1/0/27 Container
HundredGigE1/0/28 Container
SFP+ 10GBASE-SR
Twe1/0/1 Module Temperature Sensor
Twe1/0/1 Supply Voltage Sensor
Twe1/0/1 Bias Current Sensor
Twe1/0/1 Transmit Power Sensor
Twe1/0/1 Receive Power Sensor
GE T
GE T
SFP+ 10GBASE-SR'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
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 Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html