承接 okapi/wildcards 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

okapi/wildcards

最新稳定版本:1.0.1

Composer 安装命令:

composer require okapi/wildcards

包简介

PHP Wildcards is a PHP library that converts wildcards to regular expressions.

README 文档

README

PHP Wildcards

License: MIT Twitter: @WalterWoshid PHP: >=8.0 Packagist Build

Coverage - PHP 8.0 Coverage - PHP 8.1 Coverage - PHP 8.2

PHP Wildcards is a PHP library that converts wildcards to regular expressions.

Installation

composer require okapi/wildcards

Usage

<?php

use Okapi\Wildcards\Regex;

// Simple wildcard
$regex = Regex::fromWildcard('*.php');
$regex->matches('index.php'); // true
$regex->matches('index.html'); // false

// Wildcard with groups
$regex = Regex::fromWildcard('(*.php)|(*.html)');
$regex->matches('index.php'); // true
$regex->matches('index.html'); // true
$regex->matches('index.js'); // false

// Wildcard with optional characters
$regex = Regex::fromWildcard('index[*].php');
$regex->matches('index.php'); // true
$regex->matches('index.test.php'); // true
$regex->matches('index_2.php'); // true

Supported Wildcards

  • * = any number of characters
  • ? = any single character
  • [ ] = optional characters
  • ( ) = group
  • | = or

Testing

  • Run composer run-script test
    or
  • Run composer run-script test-coverage

Show your support

Give a ⭐ if this project helped you!

📝 License

Copyright © 2023 Valentin Wotschel.
This project is MIT licensed.

统计信息

  • 总下载量: 9.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-10