I have the following list of string
mystring = [
'FOO_LG_06.ip',
'FOO_LV_06.ip',
'FOO_SP_06.ip',
'FOO_LN_06.id',
'FOO_LV_06.id',
'FOO_SP_06.id']
What I want to do is to print it out so that it gives this:
LG.ip
LV.ip
SP.ip
LN.id
LV.id
SP.id
How can I do that in python?
I'm stuck with this code:
for soth in mystring:
print soth
In Perl we can do something like this for regex capture:
my ($part1,$part2) = $soth =~ /FOO_(\w+)_06(\.\w{2})/;
print "$part1";
print "$part2\n";