搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案