Question: Sorry my title must be quite confused. What I want to mean is like this. Let's say, I have total more than 100 html existing files. I want to put this code before end of the head tag. 

```
        <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

```

I don't want to open every page and insert manually. Because it's lots of file. I tried to do with Find & replace, but it doesn't allow me to add because it's have lots of lines.

So anyway to inject the codes to every page very easily ? 

Please kindly help thanks.

Answer: 
One regex for all, just for the fun. The i at the end is for case insensitivity. Probably not fast, but "one shot".

**HTML colors**

```
/^(#[a-f0-9]{6}|black|green|silver|gray|olive|white|yellow|maroon|navy|red|blue|purple|teal|fuchsia|aqua)$/i

```

**CSS colors**

```
/^(#[a-f0-9]{6}|#[a-f0-9]{3}|(rgb|hsl) *\( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *\)|(rgba|hsla) *\( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *\)|black|green|silver|gray|olive|white|yellow|maroon|navy|red|blue|purple|teal|fuchsia|aqua)$/i

```
```
using System.Text.RegularExpressions;

var regexColorCode = new Regex("^#[a-fA-F0-9]{6}$");
string colorCode = "#FFFF00";

if (!regexColorCode.IsMatch(colorCode.Trim()))
{   
    ScriptManager.RegisterStartupScript(this, GetType(), "showalert" ,"alert('Enter a valid Color Code');", true);
}
else
{
    //do your thing
}

```