に一致した後、私はO
のためのマッチングと使用して完全なラインを印刷しています。この文字列から文字列は、文字列
output = '''Gateway of last resort is not set
10.0.1.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.0.0/24 is directly connected, Ethernet1/0
L 10.1.0.1/32 is directly connected, Ethernet0/0
C 10.2.0.0/24 is directly connected, Ethernet0/1
L 19.18.2.1/32 is directly connected, Serial2/1
O 19.18.3.0/20 [110/128] via 19.18.2.2, 00:00:50, Serial1/1
[110/128] via 19.18.1.2, 00:00:50, Serial1/0
O 12.18.3.1/20 [110/128] via 19.18.2.2, 00:00:50, Serial1/1
[110/128] via 19.18.1.2, 00:00:50, Serial1/0
O 12.18.1.0/20 [110/128] via 19.18.2.2, 00:00:50, Serial0/1
[110/128] via 19.18.1.2, 00:00:50, Serial0/0'''
を持っても、次の行を印刷したいです
['19.18.3.0/20 [110/128] via 19.18.2.2, 00:00:50, Serial1/1', '12.18.3.1/20 [110/128] via 19.18.2.2, 00:00:50, Serial1/1', '12.18.1.0/20 [110/128] via 19.18.2.2, 00:00:50, Serial0/1']
しかし、これらの行も上記の出力とともに印刷したいと思います。
[110/128] via 19.18.1.2, 00:00:50, Serial1/0, [110/128] via 19.18.1.2, 00:00:50, Serial1/0, [110/128] via 19.18.1.2, 00:00:50, Serial0/0
あなたの提案をありがとう、そしてはい、私のためにコマンドが働いた。 –
それはあなたのために働いてうれしい。答えを受け入れることを検討してください([回答を受け入れる方法](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)を参照してください)。 ([Stack Overflowについてのアップルのしくみ?](http://meta.stackexchange.com/questions/173399/how-to-upvote-on-stack-overflow)を参照してください)。 –