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 1w 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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODYzODI3NTcsIm5iZiI6MTc4NjM4MjQ1NywicGF0aCI6Ii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C1BbXotU2lnbmF0dXJlPTU3N2UxMzE4NzZjM2QxMzk4YzQxODZlNzllOWRhOTllOTMyYmZjY2YzMmJjNmQwMTM3ODJlMGQ1MDc3NWY2YTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.vOiGRuZoar16w7aANOuJ32sfsZlDoigQoJvK-BhEBEU)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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODYzODI3NTcsIm5iZiI6MTc4NjM4MjQ1NywicGF0aCI6Ii8yNTU5NDgyNi8zODYzMTE5MDUtNDVlZmQxNTEtMmI5MS00NmZmLThhM2MtZDA2YzFlNDVhMmJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODEwVDE3MjA1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIwOTU0MDA5YTViYTE4ZjE2Y2IzY2E1NzNhMzNiMmRlMTdmMGMzODA0ZDViOWYwNzA1MDQ4ODgzMzJmZTRhOGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.DPI0xekXRRg3EeHPRx2XdiJLrQPd5_-1GK5nHKfy4Z4)](https://private-user-images.githubusercontent.com/25594826/386311905-45efd151-2b91-46ff-8a3c-d06c1e45a2bc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODYzODI3NTcsIm5iZiI6MTc4NjM4MjQ1NywicGF0aCI6Ii8yNTU5NDgyNi8zODYzMTE5MDUtNDVlZmQxNTEtMmI5MS00NmZmLThhM2MtZDA2YzFlNDVhMmJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwODEwVDE3MjA1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIwOTU0MDA5YTViYTE4ZjE2Y2IzY2E1NzNhMzNiMmRlMTdmMGMzODA0ZDViOWYwNzA1MDQ4ODgzMzJmZTRhOGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.DPI0xekXRRg3EeHPRx2XdiJLrQPd5_-1GK5nHKfy4Z4)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity17

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://avatars.githubusercontent.com/u/25594826?v=4)[LinneaHarts](/maintainers/LinneaHarts)[@LinneaHarts](https://github.com/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

[toplan/laravel-sms

A mobile phone number validation solution based on laravel

83580.2k2](/packages/toplan-laravel-sms)[hyperf/validation

hyperf validation

122.2M213](/packages/hyperf-validation)[udokmeci/yii2-phone-validator

Modern Yii2 Phone validator wrapper on top of PhoneNumberUtil library also used by Android devices

36227.5k1](/packages/udokmeci-yii2-phone-validator)[snowcap/vat-validation

EU VAT number validation

10112.3k](/packages/snowcap-vat-validation)

PHPackages © 2026

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