--- a/wicd-1.5.9/wicd/wnettools.py
+++ b/wicd-1.5.9/wicd/wnettools.py
@@ -50,7 +50,7 @@ strength_pattern    = re.compile('.*Quality:?=? ?(\d+)\s*/?\s*(\d*)', re.I | re.
 # for displaying actual signal strength (-xx dBm).
 altstrength_pattern = re.compile('.*Signal level:?=? ?(\d\d*)', re.I | re.M | re.S)
 signaldbm_pattern   = re.compile('.*Signal level:?=? ?(-\d\d*)', re.I | re.M | re.S)
-mode_pattern        = re.compile('.*Mode:(.*?)\n', re.I | re.M  | re.S)
+mode_pattern        = re.compile('.*Mode:([A-Za-z-]*?)\n', re.I | re.M  | re.S)
 freq_pattern        = re.compile('.*Frequency:(.*?)\n', re.I | re.M  | re.S)
 ip_pattern          = re.compile(r'inet [Aa]d?dr[^.]*:([^.]*\.[^.]*\.[^.]*\.[0-9]*)', re.S)
 bssid_pattern       = re.compile('.*Access Point: (([0-9A-Z]{2}:){5}[0-9A-Z]{2})', re.I | re.M | re.S)
@@ -877,6 +877,9 @@ class WirelessInterface(Interface):
 
         # Mode
         ap['mode'] = misc.RunRegex(mode_pattern, cell)
+        if ap['mode'] is None:
+            print 'Invalid network mode string, ignoring!!'
+            return None
 
         # Break off here if we're using a ralink card
         if self.wpa_driver == RALINK_DRIVER:
