Add regex docs to plugin.php page
This commit is contained in:
24
plugin.php
24
plugin.php
@@ -103,7 +103,29 @@ function better_blacklist_display_form() {
|
|||||||
<input type="hidden" name="action" value="blacklist_domain" />
|
<input type="hidden" name="action" value="blacklist_domain" />
|
||||||
<input type="hidden" name="nonce" value="$nonce" />
|
<input type="hidden" name="nonce" value="$nonce" />
|
||||||
<p>Enter domains to blacklist (one per line):</p>
|
<p>Enter domains to blacklist (one per line):</p>
|
||||||
<textarea class="blacklist-domains" cols="60" rows="15" name="blacklist_form">$blacklist_domains</textarea>
|
|
||||||
|
<details>
|
||||||
|
<summary>Advanced Usage (Regex)</summary>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
You can use regular expressions (Regex) to define more complex patterns for blacklisting domains.<br>
|
||||||
|
To use Regex, enter your pattern between slashes (/).<br>
|
||||||
|
|
||||||
|
For example, to block all subdomains of example.com, you could enter <code>/\.example\.com$/i</code>.<br>
|
||||||
|
The <kbd>i</kbd> flag at the end makes the match case-insensitive. Usually you want to use this flag.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Further examples:</b><br>
|
||||||
|
<code>/.*\.xxx$/i</code> - Blocks all domains ending with .xxx<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
Be cautious when using Regex, as incorrect patterns can lead to unintended blocking of domains.<br>
|
||||||
|
Always test your Regex patterns to ensure they work as expected.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</details><br>
|
||||||
|
<textarea class="blacklist-domains" cols="60" rows="15" name="blacklist_form" placeholder="Example: block.example.com">$blacklist_domains</textarea>
|
||||||
<p><input type="submit" value="Save" /></p>
|
<p><input type="submit" value="Save" /></p>
|
||||||
</form>
|
</form>
|
||||||
HTML;
|
HTML;
|
||||||
|
|||||||
Reference in New Issue
Block a user