# Regular Expression

A text pattern used to find, validate, or replace matching characters.

## What is **Regular Expression** in C#?

**Regular Expression** — A text pattern used to find, validate, or replace matching characters.

```csharp
using System.Text.RegularExpressions;

class OrderId
{
    bool IsValid(string value)
    {
        return Regex.IsMatch(value, @"^ORD-\d{4}$");
    }
}
```

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/journeyman)

Updated: September 27, 2026

## In other subjects

- [Regular Expression in Java](https://www.ask-codey.com/glossary/regular-expression-java)
- [Regular Expression in JavaScript](https://www.ask-codey.com/glossary/regular-expression-javascript)

Source: https://www.ask-codey.com/glossary/regular-expression-c-sharp
