--- a/sources/trunk/src/Utils.cc
+++ b/sources/trunk/src/Utils.cc
@@ -19,6 +19,7 @@
 
 #include <sstream>
 #include <iomanip>
+#include <regex.h>
 
 namespace GParted
 {
@@ -262,4 +263,20 @@
 	return exit_status ;
 }
 
+Glib::ustring Utils::regexp_label( const Glib::ustring & text,
+				const Glib::ustring & regular_sub_expression ) {
+	Glib::ustring label = "";
+	regex_t    preg ; 
+	int        nmatch = 2 ;
+	regmatch_t pmatch[  2 ] ;
+	int rc = regcomp( &preg, regular_sub_expression .c_str(), REG_EXTENDED | REG_ICASE | REG_NEWLINE ) ;
+	if (   ( rc == 0 ) //Reg compile OK
+		&& ( regexec( &preg, text .c_str(), nmatch, pmatch, 0 ) == 0 ) //Match found
+	   )
+	{
+		label = text .substr( pmatch[1].rm_so, pmatch[1].rm_eo - pmatch[1].rm_so ) ;
+	}
+	return label ;
+}
+
 } //GParted..