sofac/rfc-3986
最新稳定版本:v1.0.0
Composer 安装命令:
composer require sofac/rfc-3986
包简介
Working with URIs/URLs following Standard 3986
README 文档
README
Require
_ PHP 8.4 or higher
Using
use Sofac\Standards\Rfc3986\Character; use Sofac\Standards\Rfc3986\Enums\DelimiterRegex; /* SOME USEFUL CONSTANTS */ $genDelims = Character::GEN_DELIMS; $subDelims = Character::SUB_DELIMS; echo "<pre>"; print_r($genDelims); echo "</pre>"; /* result $subDelims Array ( [0] => : [1] => / [2] => ? [3] => # [4] => [ [5] => ] [6] => @ ) */ /* METHODS */ /* Returns already escaped sub-delims for use in regex. */ $sub = Character::subDelimsForRegex(); // '\!\$&'\(\)\*\+,;\=' /* Returns already escaped sub-delims for use in regex. except */ $subExcept = Character::subDelimsForRegex(')','=');// '\!\$&'\(\*\+,;' /* Regex builder, still under development. */ $regex = Character::makerRegex( DelimiterRegex::SLASH_DELIMITER, '(?:[^', Character::unreservedForRegex(), Character::subDelimsForRegex(), Character::gemDelimsForRegex("#", "[", "]"), '%]++|', Character::percentIdentifyRegex(), ')' ); echo $regex; /* result: '/(?:[^A-Za-za-z0-9\-\._~\!\$&'\(\)\*\+,;\=\:\/\?@%]++|%(?![A-Fa-f0-9]{2}))/' */
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-11