string pattern = @"<div[ \t]*(I|i)d=(""?)(?<id>\w+)(""?)[ \t].*</div>";
            
            Regex regx = new Regex(pattern, RegexOptions.IgnoreCase);

            foreach (Match match in regx.Matches(str))
            {                
                str = str.Replace(match.Value, (string)HttpContext.GetGlobalResourceObject(match.Groups["id"].Value));
            }

            Response.Write(str);
<div id="2"></div>
Arasıını alır