From 07e3da08d01d27b39b1bdec84cabef4803454146 Mon Sep 17 00:00:00 2001
From: Andrew Ferguson <adferguson@gmail.com>
Date: Sun, 19 Jan 2014 18:33:27 -0500
Subject: [PATCH] adjust regex for finding mininet's links during cleanup

link names of the form "a-b-ethN" were previously interpreted
as "b-ethN". this change accepts link names with a dash, and
requires N to only contain digits.
---
 mininet/clean.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mininet/clean.py b/mininet/clean.py
index 5162bf37..35fbd0f8 100755
--- a/mininet/clean.py
+++ b/mininet/clean.py
@@ -59,7 +59,7 @@ def cleanup():
             sh( 'ovs-vsctl del-br ' + dp )
 
     info( "*** Removing all links of the pattern foo-ethX\n" )
-    links = sh( r"ip link show | egrep -o '(\w+-eth\w+)'" ).split( '\n' )
+    links = sh( r"ip link show | egrep -o '([-_[:alnum:]]+-eth[[:digit:]]+)'" ).split( '\n' )
     for link in links:
         if link != '':
             sh( "ip link del " + link )
-- 
GitLab