I got info about ports from cisco switchs. I get the information with a command on the switch.
Show interfac status
And I got lines like:
GI1/0/1 1089.22 Office_Name disabled 88 1000 Full
Or:
FA0/1 Big Room connected 120 100 Half
And Im trying to analyze the data with regular expression. The end result should be:
Line[0] = GI1/0/1
Line[1] = 1089.22 Office_Name
Line[2] = disabled
Line[3] = 88
Line[4] = 1000
Line[5] = Full
What is the best way to make it?
(I tried this expression but its work very bed)
/\D+\d+((/\d)+(\.\d+)?)?\s(.*)\s(disabled|connected)\s(.*)\s(10|100|1000)?\s(Full|Half)/