chevere/regex 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

chevere/regex

Composer 安装命令:

composer require chevere/regex

包简介

Validated regular expression

README 文档

README

Chevere

Build Code size Apache-2.0 PHPStan Mutation testing badge

Quality Gate Status Maintainability Rating Reliability Rating Security Rating Coverage Technical Debt CodeFactor

Summary

Regex enables to work with a validated regular expression.

Installing

Regex is available through Packagist and the repository source is at chevere/regex.

composer require chevere/regex

Creating Regex

Create a Regex by passing the regular expression pattern.

use Chevere\Regex\Regex;

$regex = new Regex('/^Hello World!$/');

Reading pattern

As-is

The __toString method is used to access the pattern passed on instance creation.

$string = $regex->__toString();
// /^Hello World!$/

Without delimiters

The noDelimiters method is used to access to the regex pattern without delimiters.

$string = $regex->noDelimiters();
// ^Hello World!$

Without delimiters and anchors

The noDelimitersNoAnchors method is used to access to the regex pattern without delimiters and anchors.

$string = $regex->noDelimitersNoAnchors();
// Hello World!

Match

The match method provides preg_match.

$array = $regex->match('Hello World!');
// [Hello World!]

Match All

The matchAll method provides preg_match_all.

$regex->matchAll();
// [Hello World!]

Assert Match

The assertMatch method asserts that the string matches. It throws Exceptions\NoMatchException when failing to assert.

$regex->assertMatch('Hello World!');

Assert Match All

The assertMatchAll method asserts that the string matches all. It throws Exceptions\NoMatchException when failing to assert.

$regex->assertMatchAll('Hello World!');

Documentation

Documentation is available at chevere.org.

License

Copyright 2024 Rodolfo Berrios A.

Chevere is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

chevere/regex 适用场景与选型建议

chevere/regex 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30.41k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2023 年 11 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 chevere/regex 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 chevere/regex 我们能提供哪些服务?
定制开发 / 二次开发

基于 chevere/regex 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 30.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 24
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2023-11-30