I am trying to delete a line on a file that looks like this:

test 1800 IN CNAME mydomain.com.

I am using sed on Mountain Lion and I am trying the following but I keep getting no errors, however the line is not deleted.

```
sed -i -e '/$regex/d' $file

```

or

```
sed -i "" -e '/$regex/d' $file

```

Where the $regex is the expression containing the line mention above and the $file is the name of the file where the line is.

Any help Will be appreciate it.