Last updated:
0 purchases
localregex
LocalRegex #
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>
copied to clipboard
Or #
flutter pub add localregex
copied to clipboard
Import package #
import 'package:localregex/localregex.dart';
copied to clipboard
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');
copied to clipboard
Check if a mobile number matches any of the patterns for Econet, Netone or Telecel #
LocalRegex.isZimMobile('mobile_number');
copied to clipboard
Check if mobile number is valid (recommended for numbers not from Zimbabwe) #
LocalRegex.isValidMobile('mobile_number');
copied to clipboard
Check if Zimbabwean landline number is valid #
LocalRegex.isZimLandline('landline_number');
copied to clipboard
Check if a supplied email matches proper email patterns #
LocalRegex.isEmail('email_address');
copied to clipboard
Check if a supplied national id matches the pattern for Zimbabwean national id #
LocalRegex.isZimID('national_id');
copied to clipboard
Check passport number #
LocalRegex.isZimPassport('passport_number');
copied to clipboard
Check number plate #
LocalRegex.isZimNumberPlate('number_plate');
copied to clipboard
Check driver's license #
LocalRegex.isZimDriversLicence('drivers_license');
copied to clipboard
Check URL #
LocalRegex.isUrl("https://www.google.com");
copied to clipboard
Check phone number and returns phone number in required format (for use with Zim numbers only) #
String? number = '+263777213388'.formatNumber(formatType: FormatType.regular);
copied to clipboard
Check if password is valid (minimum of 8 characters, at least 1 special character, 1 capital letter, 1 numeric character) #
LocalRegex.isPassword('your_password');
copied to clipboard
Mobile Number Format Types #
Regular #
This is the general format of mobile numbers e.g. 0777213388
FormatType.regular
copied to clipboard
Country Code #
This is the mobile number format with country code but no + sign e.g. 263777213388
FormatType.countryCode
copied to clipboard
Country Code Plus #
This is the mobile number format with country code and + sign e.g. +263777213388
FormatType.countryCodePlus
copied to clipboard
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
copied to clipboard
School Student IDs #
You can validate Student IDs for multiple tertiary institutions in Zimbabwe.
LocalSchools.hit.isStudent('studentID')
copied to clipboard
Contributors #
Ngonidzashe Mangudya
Kudakwashe Kuzvindiwana
Donald Chinhuru
Add your contributions
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.