搜索插件、代码仓与 APP 分类

插件详情v4.0.9

localregex

津巴布韦常用正则表达式模式集合。正则表达式模式包括手机号码、护照、车辆牌照、驾照、电子邮件地址和密码

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
192
喜欢数
22
Pub 分数
150

安装插件

flutter pub add localregex

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

LocalRegex 是一个 Flutter 包,提供针对津巴布韦常见数据验证的预定义正则表达式。它包含手机号码、护照、车辆牌照、驾驶执照、电子邮件地址和密码的模式。专为面向津巴布韦用户的开发者设计,通过准确且本地相关的正则规则简化输入验证。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台,确保在各种环境中实现一致的验证。

适合场景

  • 验证津巴布韦手机号码
  • 验证护照号码
  • 检查车辆牌照格式
  • 验证驾驶执照信息
  • 电子邮件和密码输入验证
  • 本地应用程序中的表单验证

主要特点

  • 津巴布韦特定的正则表达式模式
  • 对多种输入类型的支持
  • 跨平台兼容性
  • 通过 pub 实现轻松集成
  • 经过预测试且可靠的模式
  • 轻量且专注

适合对象

  • 津巴布韦的移动和网络应用
  • 政府或身份验证系统
  • 用户注册表单
  • 本地环境中的数据收集工具
  • 需要准确本地格式的应用程序

使用建议

  • 限于津巴布韦标准
  • 需要手动更新以支持新格式
  • 不适用于国际使用
  • 依赖外部源进行维护
  • 无内置 UI 组件
  • 验证逻辑必须由开发者实现

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

LocalRegex

style: very good analysis License: MIT Coverage

This plugin allows developers to check if an input matches common regex patterns in Zimbabwe and other countries. This plugin works for all Flutter supported platforms i.e. Android, iOS, Web and Desktop (Linux, Windows & MacOS).

Developed by Ngonidzashe Mangudya. Special shoutout to Kudakwashe Kuzvindiwana & Donald Chinhuru for pushing this package the most.

Usage

Add dependency
dependencies:
  localregex: <version>
Or
flutter pub add localregex
Import package
  import 'package:localregex/localregex.dart';

Note that declaration and initialization is no longer necessary

Check if a mobile number matches patterns for Econet, Netone or Telecel numbers
LocalRegex.isNetone('mobile_number');
LocalRegex.isEconet('mobile_number');
LocalRegex.isTelecel('mobile_number');
Check if a mobile number matches any of the patterns for Econet, Netone or Telecel
LocalRegex.isZimMobile('mobile_number');
Check if mobile number is valid (recommended for numbers not from Zimbabwe)
LocalRegex.isValidMobile('mobile_number');
Check if Zimbabwean landline number is valid
LocalRegex.isZimLandline('landline_number');
Check if a supplied email matches proper email patterns
LocalRegex.isEmail('email_address');
Check if a supplied national id matches the pattern for Zimbabwean national id
LocalRegex.isZimID('national_id');
Check passport number
LocalRegex.isZimPassport('passport_number');
Check number plate
LocalRegex.isZimNumberPlate('number_plate');
Check driver's license
LocalRegex.isZimDriversLicence('drivers_license');
Check URL
LocalRegex.isUrl("https://www.google.com");
Check phone number and returns phone number in required format (for use with Zim numbers only)
String? number = '+263777213388'.formatNumber(formatType: FormatType.regular);
Check if password is valid (minimum of 8 characters, at least 1 special character, 1 capital letter, 1 numeric character)
LocalRegex.isPassword('your_password');

Mobile Number Format Types

Regular

This is the general format of mobile numbers e.g. 0777213388

FormatType.regular
Country Code

This is the mobile number format with country code but no + sign e.g. 263777213388

FormatType.countryCode
Country Code Plus

This is the mobile number format with country code and + sign e.g. +263777213388

FormatType.countryCodePlus

Format National ID

Here the output format to be used is 11-223344 K 55 as found on most national identity documents in Zimbabwe

'11223344K55'.formatID(formatType: IdFormatType.proper); // > 11-223344 K 55

School Student IDs

You can validate Student IDs for multiple tertiary institutions in Zimbabwe.

LocalSchools.hit.isStudent('studentID')

Contributors


Ngonidzashe Mangudya

Kudakwashe Kuzvindiwana

Donald Chinhuru
Add your contributions

所属分类

源码仓库

使用此插件的项目