chevere/regex
Composer 安装命令:
composer require chevere/regex
包简介
Validated regular expression
README 文档
README
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 30.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 24
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2023-11-30