Had two inputs based on the device it need to match any of input using Or and give the version output like 7.0.3I4.6 or 7.1.4.N1.1
Input-1 NXOS image file is: bootflash:///nxos.7.0.3.I4.6.bin
Input-2 kickstart image file is: bootflash:///n6000-uk9-kickstart.7.1.4.N1.1.bin system image file is: bootflash:///n6000-uk9.7.1.4.N1.1.bin
Please suggest how to filter using Or and regular expression
Tried
regex_version = re.compile(r'(NXOS:\sversion\s(\S+))|(kickstart:\sversion\s(\S+))')
version = regex_version.findall(input)
Tried
regex_version = re.compile(r'(NXOS:\sversion\s(\S+))|(kickstart:\sversion\s(\S+))')
version = regex_version.findall(input)
output: [('NXOS: version 7.0(3)I4(6)', '7.0(3)I4(6)', '', '')] [('', '', 'kickstart: version 7.1(4)N1(1)', '7.1(4)N1(1)')]
how to filter 7.0(3)I4(6) and 7.1(4)N1(1) based on the input