Image link here. Ben Basit Python Regex kelimeleri ayırmak için
m = re.compile('(\w+\s\w+)')
n = m.findall(buffer)
çalışıyor Ve bu çıktıyı alıyorum
['bandwidth' , 'beacon' , 'cdp' , 'channel-group' , 'delay' , 'description']
:
['config t', 'Enter configuration', 'one per', 'End with', 'profile demo_ethernet', 'Set bandwidth', 'informational parameter', 'enable the', 'beacon for', 'an interface', 'Configure CDP', 'interface parameters', 'Configure port', 'channel parameters', 'Specify interface', 'throughput delay', 'Enter port', 'profile description', 'of maximum', '80 characters']
Bunu istiyorum, yukarıdaki çıktıda
config t
Enter configuration commands, one per line. End with CNTL/Z.
n7k(config)# port-profile demo_ethernet
n7k(config-port-prof)# ?
bandwidth Set bandwidth informational parameter
beacon Disable/enable the beacon for an interface
cdp Configure CDP interface parameters
channel-group Configure port channel parameters
delay Specify interface throughput delay
description Enter port-profile description of maximum 80 characters
: Aşağıdaki yönlendirici çıkışı
Eşleme kuralı nedir? –
Sol taraf tuşlarını istiyorum. ve ilk dört satırdan sonra. – ursandy
Lütfen verilerinizi doğru biçimlendirin. Uzun bir dizgi olarak görünür. –