I have a plugin that inserts some rewrite rule in the .htaccess file. However, upon deactivating it, doesn't remove said rule. The rule is nested in `# BEGIN My plugin` and `# END My plugin`.

I want to create an uninstall.php file for this plugin to remove the rule created on acrivation.

I've never done this before. I suppose I can get the .htaccess with 

```
$htaccess = dirname(__FILE__) . '/../../../.htaccess';

```

should I use a regex or is there a proper way to remove a specific rule from the .htaccess?