I have a bunch of files (in the hundreds) that have img tags like the following:
<img randomAttr1="randomVal" randomAttr2="valueRand" border="0"
randomAttr3="someRandValue">
I'm trying to do a search and replace operation in Visual Studio 2005 that will identify a tag as an <img>, but only match the border="0" potion of the string.
My belief is that I need a non-greedy portion of the regular expression to "match" (and I use the term loosely) the img tag and then actually match the border attribute, so that I can remove it.
I'm using regular expressions to do this as nearly none of the markup is well formed.
My goal here is to remove the border attributes from all of the img tags.
I've tried the following regex, but I can't seem to get it to match only the border tag:
(\<img)#.@border=\"[0-9]+\"
I believe the '#' and the '@' to be non-greedy matching characters as that is what the documentation for VS-2005 says, and thus I would not think that it would match so many characters; however it matches everything from the <img all the way to the end of the border="0" attribute.