var regexp = module.exports;

/*=====
dojo.regexp = {
	// summary: Regular expressions and Builder resources
};
regexp = dojo.regexp;
=====*/
regexp.escapeString = function(/*String*/str, /*String?*/except){
	//	summary:
	//		Adds escape sequences for special characters in regular expressions
	// except:
	//		a String with special characters to be left unescaped

	return str.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, function(ch){
		if(except && except.indexOf(ch) !== -1){
			return ch;
		}
		return "\\" + ch;
	}); // String
};