Index: Tomboy/Watchers.cs
===================================================================
--- Tomboy/Watchers.cs	(révision 2394)
+++ Tomboy/Watchers.cs	(copie de travail)
@@ -373,14 +373,57 @@
 		NoteTag url_tag;
 		Gtk.TextMark click_mark;
 
+		    //+		    @"(?<=(?<starter>["			    // preceded by a starter (opening parenthesis...)
 		const string URL_REGEX =
-		        @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S*@\S*\.)|(^|\s)/\S+/|(^|\s)~/\S+)\S*\b/?)";
+			    @"("
+		    +		@"("
+		    +		    @"(?<=(?<starter>("	    // preceded by a starter 
+		    +			 @"(?<starterA>(\())"	//	opening parenthesis closed by ) 
+		    +			@"|(?<starterB>(\[))"	// or	opening bracket	    closed by ]
+		    +			@"|(?<starterC>(\{))"	// or	opening thing	    closed by }
+		    +		    @")))"
+		    +		    @"|\b"			    //  or at beginning of a word \b
+		    +		@")"
+		    +		@"("					
+		    +		    @"("					
+		    +			@"(news|http|https|ftp|file|irc)://"    // http:// ...
+		    +		        @"|mailto:"				// or mailto...
+		    +			@"|(www|ftp)\."				// or www...
+		    +		        @"|\S*@\S*\."				// or email adress
+		    +		    @")"
+		    +		    @"|/\S+/"				// or starting with '/'
+		    +		    @"|~/\S+"				// or starting with '~/'
+		    +		@")"
+		    +		@"(?(starter)"			    // 	
+		    +		    @"(\S(?!("			    // if starter detected : forbid ender 
+									//ignore this comment (for syntax) ([{
+		    +			@"(?(starterA)\)|"				// closing parenthesis 
+		    +			@"(?(starterB)\]|"				// closing bracket 
+		    +			@"(?(starterC)\})))"				// closing thing 
+		    +		    @")))*\S?"		
+		    +		    @"|\S*"			    // else anything without space
+		    +		@")"
+		    +	    @")";
+ 
+		
+		// DEBUG: regression test for Bug 531085
+		// from version 1991 (including patch id=110279) 
+	    	const string URL_REGEX_old_version = @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S*@\S*\.)|/\S+/|~/\S+)\S*\b/?)";
+		// see also below in "static NoteUrlWatcher ()"
+		
+		// older version	(without patch id=110279)
+		//     @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S*@\S*\.)|(^|\s)/\S+/|(^|\s)~/\S+)\S*\b/?)";
+	    
 
 		static Regex regex;
 		static bool text_event_connected;
 
 		static NoteUrlWatcher ()
 		{
+			// DEBUG: regression test for Bug 531085
+		Logger.Log ("[URL_WATCH] OLD version =>{0}<=",URL_REGEX_old_version );
+		Logger.Log ("[URL_WATCH] NEW version =>{0}<=",URL_REGEX);
+			// END_OF_DEBUG: regression test
 			regex = new Regex (URL_REGEX,
 			                   RegexOptions.IgnoreCase | RegexOptions.Compiled);
 			text_event_connected = false;

