---
description: Changing how the regular expression works
---

# Regular Expression Drivers

<figure><img src="https://979265983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKBgZy6xqjdYb7KIbxI6u%2Fuploads%2Fgit-blob-7d7d7483a7fd1ba368d3e6da5909d1745246366b%2F127-inner.png?alt=media" alt=""><figcaption></figcaption></figure>

The regular expression driver is one of the supported driver types on Nitrocid KS. These drivers allow you to change how the regular expression works, thus earning dynamic regular expression improvements.

The regular expression drivers have the following characteristics:

* Interface: `IRegexpDriver`
* Base class: `BaseRegexpDriver`

The regular expression drivers have the following functions that you can optionally override below:

{% code title="IRegexpDriver.cs" lineNumbers="true" %}
```csharp
bool IsValidRegex([StringSyntax(StringSyntaxAttribute.Regex)] string pattern);
bool IsMatch(string text, [StringSyntax(StringSyntaxAttribute.Regex)] string pattern);
Match Match(string text, [StringSyntax(StringSyntaxAttribute.Regex)] string pattern);
MatchCollection Matches(string text, [StringSyntax(StringSyntaxAttribute.Regex)] string pattern);
string Filter(string text, [StringSyntax(StringSyntaxAttribute.Regex)] string pattern);
string Filter(string text, [StringSyntax(StringSyntaxAttribute.Regex)] string pattern, string replaceWith);
string[] Split(string text, [StringSyntax(StringSyntaxAttribute.Regex)] string pattern);
string Escape(string text);
string Unescape(string text);
```
{% endcode %}

The `RegexpDriverTools` class contains tools to get all the regular expression drivers and their names and set a regular expression driver as a default. The driver management tools also allow you to do the same thing, though you'll have to specify the driver type.
