Skip to main content

Validate Zimbabwe-specific patterns with ease

LocalRegex is a Dart library that provides validation and formatting for Zimbabwean mobile numbers, national IDs, passports, and more — built for Flutter and Dart applications.

import 'package:localregex/localregex.dart';

// Validate mobile numbers
LocalRegex.isZimMobile('0777213388'); // true

// Format phone numbers
'+263777213388'.formatNumber(
  formatType: FormatType.regular
); // 0777213388

// Validate national IDs
LocalRegex.isZimID('11223344K55'); // true

Quick start

Get up and running with LocalRegex in your Dart or Flutter project.

1

Add the dependency

Add LocalRegex to your pubspec.yaml file:
pubspec.yaml
dependencies:
  localregex: ^4.0.7
Then run flutter pub get or dart pub get to install the package.
2

Import the library

Import LocalRegex in your Dart file:
import 'package:localregex/localregex.dart';
3

Start validating

Use LocalRegex to validate Zimbabwean patterns:
// Validate mobile numbers by provider
bool isEconet = LocalRegex.isEconet('0777213388');
bool isNetone = LocalRegex.isNetone('0712345678');
bool isTelecel = LocalRegex.isTelecel('0734567890');

// Or validate any Zimbabwe mobile number
bool isValid = LocalRegex.isZimMobile('0777213388');

// Validate national IDs
bool isValidID = LocalRegex.isZimID('11223344K55');

// Validate passports
bool isValidPassport = LocalRegex.isZimPassport('AN123456');

Explore by feature

Discover what you can validate and format with LocalRegex.

Mobile numbers

Validate Zimbabwean mobile numbers from Econet, Netone, and Telecel.

Identity documents

Validate national IDs, passports, number plates, and driver’s licenses.

Phone formatting

Format phone numbers with country codes or regular formats.

VoIP providers

Validate numbers from Zimbabwean VoIP providers.

Student IDs

Validate student IDs from major tertiary institutions.

General utilities

Validate emails, URLs, passwords, dates, and IP addresses.

Resources

Additional guides and reference materials.

Examples

Real-world usage examples and patterns.

API reference

Complete API documentation.

Changelog

Version history and updates.

Ready to get started?

Add LocalRegex to your Flutter or Dart project and start validating Zimbabwean patterns in minutes.

View quickstart guide

Build docs developers (and LLMs) love