I have the basic pattern:

```
Input = Regex.Replace(Input, "#(.+?)#", "<h3>$1</h3>");

```

Now I only want this to match IF the line it's on DOESN'T start with 4 space characters. For example:

```
This line #would match#
    #this one# wouldn't

```

I've got as far as:

```
Input = Regex.Replace(Input, "^( {4}).?#(.+?)#", "<h3>$2</h3>");

```

But this doesn't seem to work; it doesn't replace properly. Here's some test data:

```
#This is my header#

Some text, code below:

    background:#333333;
    background: #ffffff, #000000;

Testing text

#Another header#

Text

```