搜尋套件、儲存庫與 APP 分類

套件詳情v2.6.0

regexpattern

Flutter 正則表達式模式列表及其用於字串驗證的目的

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
4020
喜歡數
129
Pub 分數
150

安裝套件

flutter pub add regexpattern

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,提供一組精心挑選的正則表達式模式,用於字串驗證。每個模式都附有明確的目的,讓您輕鬆在不同平台實現一致且可靠的輸入驗證。適用於表單欄位、身分驗證流程與資料清潔,簡化將使用者輸入與常見驗證規則(如電子郵件、電話號碼、密碼等)比對的過程。此套件支援所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 表單驗證
  • 電子郵件和電話號碼檢查
  • 密碼強度驗證
  • 資料輸入淨化
  • 使用者註冊流程
  • 文字欄位遮蔽

主要特色

  • 預定義的正則表達式模式
  • 清除目的描述
  • 跨平台相容性
  • 與 Flutter 表單輕鬆整合
  • 輕量且專注
  • 開源於 GitHub

適合對象

  • 開發表單的開發者
  • 需要輸入驗證的應用程式
  • 團隊標準化驗證邏輯
  • 針對多個平台的專案
  • 尋求快速驗證解決方案的前端開發人員

使用建議

  • 限於預定義的模式
  • 無法依圖案自訂
  • 需要手動更新新圖案
  • 無內建錯誤訊息
  • 最佳搭配額外的驗證邏輯使用
  • 依賴外部來源進行更新

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

RegexPattern

Flutter collection of regex pattern for string validation.

Getting Started

In your flutter project add the dependency:

dependencies:
  ...
  regexpattern: ^2.6.0

Usage

Importing package
import 'package:regexpattern/regexpattern.dart';
Using RegexPattern
Matching string to pattern
bool hasMatch = RegexValidation.hasMatch(<String>, <RegexPattern>);

or

String text = 'https://google.com';
bool isUrl = text.isUrl(); // text.is<Pattern>();
RegexPattern

Collection of regex pattern used to validating data

Pattern username;
Pattern usernameV2;
Pattern usernameGoogle;
Pattern usernameInstagram;
Pattern usernameDiscord;
Pattern email;
Pattern url;
Pattern uri;
Pattern phone;
Pattern hexadecimal;
Pattern vector;
Pattern image;
Pattern audio;
Pattern video;
Pattern txt;
Pattern doc;
Pattern excel;
Pattern ppt;
Pattern apk;
Pattern pdf;
Pattern html;
Pattern dateTimeUTC;
Pattern dateTime;
Pattern binary;
Pattern md5;
Pattern sha1;
Pattern sha256;
Pattern ssn;
Pattern ipv4;
Pattern ipv6;
Pattern isbn;
Pattern github;
Pattern passport;
Pattern currency;
Pattern numericOnly;
Pattern alphabetOnly;
Pattern alphaNumericOnly;
Pattern alphaNumericSymbolOnly;
Pattern noWhitespace;
Pattern passwordEasy;
Pattern passwordNormal1;
Pattern passwordNormal2;
Pattern passwordNormal3;
Pattern passwordHard;
Pattern passwordEasyAllowedWhitespace;
Pattern passwordNormal1AllowedWhitespace;
Pattern passwordNormal2AllowedWhitespace;
Pattern passwordNormal3AllowedWhitespace;
Pattern passwordHardAllowedWhitespace;
Pattern uuid;
Pattern bitcoinAddress;
Pattern bitcoinTaprootAddress;
Pattern bitcoinSegwitAddress;
Pattern ethereumAddress;

CONTRIBUTION

If you wish to contribute, fork this repository and add your regex. Create a PR & i'll check it.

LICENSE

BSD 3-Clause License

Copyright (c) 2020, Agung Nursatria
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

所屬分類

原始碼儲存庫

使用此套件的專案