PHPackages                             imarc/craft-regex-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. imarc/craft-regex-field

ActiveCraft-plugin[Validation &amp; Sanitization](/categories/validation)

imarc/craft-regex-field
=======================

A field that validates inputs against a regex

041PHP

Since Nov 14Pushed 1y ago2 watchersCompare

[ Source](https://github.com/imarc/craft-regex-field)[ Packagist](https://packagist.org/packages/imarc/craft-regex-field)[ RSS](/packages/imarc-craft-regex-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

Regex Field
===========

[](#regex-field)

A CraftCMS field that validates inputs against a regex

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4.4.0 or later and PHP 8.0.2 or later, or Craft CMS 5.0 and PHP 8.2 or later.

Installation
------------

[](#installation)

You can install this plugin from the Plugin Store or with Composer.

#### From the Plugin Store

[](#from-the-plugin-store)

Go to the Plugin Store in your project’s Control Panel and search for “Regex Field”. Then press “Install”.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require imarc/craft-regex-field

# tell Craft to install the plugin
./craft plugin/install regex-field
```

Usage
-----

[](#usage)

Create a new field and choose "Regex" as the field type.

[![Screenshot 2024-11-11 at 12 10 08](https://private-user-images.githubusercontent.com/25594826/386308940-cce3b75e-bbf2-4542-8b9e-e1b1511e7c32.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MDY0OTUsIm5iZiI6MTc3NTUwNjE5NSwicGF0aCI6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QzZjAzN2U1ZTk4ZThjOGI5MjFlMGM2NWU2M2ExYWU3NWNkMzNlYTRmMjEzN2RlNzEwZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VV-AmIXgsyEnyRSHmWAsDEPjCSQEUwQN62IO0Ol4B30)Enter a regex pattern that all input in the field will be validated against.

[![Screenshot 2024-11-14 at 12 55 07](https://private-user-images.githubusercontent.com/25594826/386311905-45efd151-2b91-46ff-8a3c-d06c1e45a2bc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MDY0OTUsIm5iZiI6MTc3NTUwNjE5NSwicGF0aCI6Ii8yNTU5NDgyNi8zODYzMTE5MDUtNDVlZmQxNTEtMmI5MS00NmZmLThhM2MtZDA2YzFlNDVhMmJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDIwMDk1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3Zjg0NWQ2NWM1OTQxNzFjZGM2N2UxNzZmOGNlZDg0MDAzOTUwOGYwOTNiZGU4M2ZkNGVhY2NiOGQ5OTQ2MWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xmKYuJlGZFmva5Wb_f6qhtW0Y9NI7dxkP9rFCwwMcq0)](https://private-user-images.githubusercontent.com/25594826/386311905-45efd151-2b91-46ff-8a3c-d06c1e45a2bc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MDY0OTUsIm5iZiI6MTc3NTUwNjE5NSwicGF0aCI6Ii8yNTU5NDgyNi8zODYzMTE5MDUtNDVlZmQxNTEtMmI5MS00NmZmLThhM2MtZDA2YzFlNDVhMmJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDIwMDk1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3Zjg0NWQ2NWM1OTQxNzFjZGM2N2UxNzZmOGNlZDg0MDAzOTUwOGYwOTNiZGU4M2ZkNGVhY2NiOGQ5OTQ2MWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xmKYuJlGZFmva5Wb_f6qhtW0Y9NI7dxkP9rFCwwMcq0)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e738e9b59429e3a6710b8d43c2041f508db999af32fbd2879e4c2b648dbd8cb?d=identicon)[LinneaHarts](/maintainers/LinneaHarts)

---

Top Contributors

[![LinneaImarc](https://avatars.githubusercontent.com/u/115502772?v=4)](https://github.com/LinneaImarc "LinneaImarc (10 commits)")[![LinneaHarts](https://avatars.githubusercontent.com/u/25594826?v=4)](https://github.com/LinneaHarts "LinneaHarts (1 commits)")

### Embed Badge

![Health badge](/badges/imarc-craft-regex-field/health.svg)

```
[![Health](https://phpackages.com/badges/imarc-craft-regex-field/health.svg)](https://phpackages.com/packages/imarc-craft-regex-field)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
