« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 192 for match (0.002 sec.)
match | PHP 8.3 11523
match (PHP 8) match 式は、値の一致をチェックした結果に基づいて評価結果を分岐します。 switch 文と似ていますが、 match 式は複数の候補と比較される制約式を持ちます。 switch 文とは異なり、 三項演算子のように値を評価します。 switch 文とは異なり、 ... 弱い比較( == )ではなく、 型と値の一致チェック( === ) に基づいて行われます。 match 式は PHP 8.0.0 以降で利用可能です。 例1 match 式の構造 <?php $return_value = match ( 制約式 ) { 単一の条件式 => 返却式 , 条 ... 件式1 , 条件式2 => 返却式 , }; 例2 基本的な match 式の使い方 <?php $food = 'cake' ; $return_value = match ( $food ) { 'apple' => 'This food is an apple' , 'bar' => 'This fo ... a cake' , }; var_dump ( $return_value ); 上の例の出力は以下となります。 string(19) "This food is a cake" 例3 比較演算子と match 式を一緒に使う例 <?php $age = 18 ; $output = match ( true ) { $age < 2 => "Baby" , $age < 13 => "Child" , $age <= 19 => "T ...
https://man.mtool.work/php/8.3/control-structures.match.html
preg_match — 正規表現によるマッチングを行う | PHP 8.3 10794
preg_match (PHP 4, PHP 5, PHP 7, PHP 8) preg_match — 正規表現によるマッチングを行う 説明 function preg_match ( string $pattern , string $subject , array &$matches = null , int $flags = 0 , int $offset = 0 ): int | false pattern で指定した正 ... 規表現により subject を検索します。 パラメータ pattern 検索するパターンを表す文字列。 subject 入力文字列。 matches matches を指定した場合、検索結果が代入されます。 $matches[0] にはパターン全体にマッチしたテキストが代入され、 $matches[1 ... す。 PREG_OFFSET_CAPTURE このフラグを設定した場合、各マッチに対応する文字列のオフセットも(バイト単位で)返されます。 これは、 matches の値を配列の配列に変更することに注意してください。 配列のすべての要素が、オフセット 0 に、マッチした文字列、 オフセット ... 1 に、 subject 内でのその文字列のオフセット からなる配列になります。 <?php preg_match ( '/(foo)(bar)(baz)/' , 'foobarbaz' , $matches , PREG_OFFSET_CAPTURE ); print_r ( $matches ); ?> 上の例の出力は以下となりま ...
https://man.mtool.work/php/8.3/function.preg-match.html
Yaf_Route_Regex::__construct — Yaf_Route_Regex のコンストラクタ | PHP 8.3 9761
Yaf_Route_Regex::__construct (Yaf >=1.0.0) Yaf_Route_Regex::__construct — Yaf_Route_Regex のコンストラクタ 説明 public function Yaf_Route_Regex::__construct ( string $match , array $route , array $map = ? , array $verify = ? , string $rever ... se = ? ) パラメータ match 正規表現のパターン。リクエストの URI とマッチさせます。 もしマッチしなければ Yaf_Route_Regex は false を返します。 route リ ... _Dispatcher :: getInstance ()-> getRouter ()-> addRoute ( "name" , new Yaf_Route_Regex ( "#^/product/([^/]+)/([^/])+#" , //match request uri leading "/product" array( 'controller' => "product" , //route to product controller, ), array( 1 => "name" , / ... / now you can call $request->getParam("name") 2 => "id" , // to get the first captrue in the match pattern. ) ) ); ?> 例2 Yaf_Route_Regex (2.3.0 以降) の例 <?php /** * Use match result as MVC name */ Yaf_Dispatcher :: get ...
https://man.mtool.work/php/8.3/yaf-route-regex.construct.html
Parle pattern matching | PHP 8.3 9325
Parle pattern matching Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: [:alnum:] , [:alpha:] , [:blank:] , [:cntrl:] , [:digit:] , [:graph:] , [:lower:] , [:print:] , [:punct:] , [:space ... arle-utf32 to make them available. A particular encoding can be mapped with a correctly constructed regex. For example, to match the EURO symbol encoded in UTF-8, the regular expression [\xe2][\x82][\xac] can be used. The pattern for an UTF-8 encoded ... ion and repetition Alternation and repetition Sequence Greedy Description ...|... - Try sub-patterns in alternation. * yes Match 0 or more times. + yes Match 1 or more times. ? yes Match 0 or 1 times. {n} no Match exactly n times. {n,} yes Match at le ... ast n times. {n,m} yes Match at least n times but no more than m times. *? no Match 0 or more times. +? no Match 1 or more times. ?? no Match 0 or 1 ti ...
https://man.mtool.work/php/8.3/parle.pattern.matching.html
コメント | PHP 8.3 9227
コメント コメントは、(?# という並びにより始まり、次の閉じカッコで終わります。 カッコのネストはできません。コメント内の文字は、パターンマッチには 全く関係しません。 PCRE_EXTENDED オプションが設定されている場合は、パターン中の文字クラス外にあ ... の中でのコメントの使い方 <?php $subject = 'test' ; /* PCRE_EXTENDED を有効にせずにコメントを追加するには, (?# を使います */ $match = preg_match ( '/te(?# this is a comment)st/' , $subject ); var_dump ( $match ); /* 空白文字と # は、PCRE_EXTENDED が無効の ... 場合、パターンの一部として扱われます */ $match = preg_match ( '/te #~~~~ st/' , $subject ); var_dump ( $match ); /* PCRE_EXTENDED が有効な場合、全ての空白文字のデータや、 ... エスケープされていない # の後に続く全てが無視されます */ $match = preg_match ( '/te #~~~~ st/x' , $subject ); var_dump ( $match ); 上の例の出力は以下となります。 int(1) int(0) int(1) 他の ...
https://man.mtool.work/php/8.3/regexp.reference.comments.html
preg_match_all — 繰り返し正規表現検索を行う | PHP 8.3 8640
preg_match_all (PHP 4, PHP 5, PHP 7, PHP 8) preg_match_all — 繰り返し正規表現検索を行う 説明 function preg_match_all ( string $pattern , string $subject , array &$matches = null , int $flags = 0 , int $offset = 0 ): int | false subject を検 ... 索し、 pattern に指定した正規表現にマッチした すべての文字列を、 flags で指定した 順番で、 matches に代入します。 正規表現にマッチすると、そのマッチした文字列の後から 検索が続行されます。 パラメータ pattern 検索するパタ ... ーンを表す文字列。 subject 入力文字列。 matches マッチしたすべての内容を含む、 flags で指定した形式の多次元配列。 flags 順序を指定するフラグを指定しない場合は、 PREG_PA ... REG_PATTERN_ORDER と PREG_SET_ORDER を組み合わせて使用することは 意味をなさないので注意してください)。 PREG_PATTERN_ORDER $matches[0] はパターン全体にマッチした文字列の配列、 $matches[1] は第 1 のキャプチャ用サブパターンにマッチした文字列の配列、 とい ...
https://man.mtool.work/php/8.3/function.preg-match-all.html
RegexIterator クラス | PHP 8.3 8542
RegexIterator クラス (PHP 5 >= 5.2.0, PHP 7, PHP 8) はじめに このイテレータを使うと、別のイテレータを正規表現でフィルタリングすることができます。 クラス概要 class RegexIterator extends FilterIterator { /* 定数 */ public const int USE_KEY ; ... public const int INVERT_MATCH ; public const int MATCH ; public const int GET_MATCH ; public const int ALL_MATCHES ; public const int SPLIT ; public con ... nt = null ; /* メソッド */ public function __construct ( Iterator $iterator , string $pattern , int $mode = RegexIterator::MATCH , int $flags = 0 , int $pregFlags = 0 ) public function accept (): bool public function getFlags (): int public function g ... ind (): void public function IteratorIterator::valid (): bool } 定義済み定数 RegexIterator の操作モード RegexIterator::ALL_MATCHES 現在のエントリにマッチするものをすべて返します ( preg_match_all() を参照ください)。 RegexIterator::GET_MATCH 現在のエント ...
https://man.mtool.work/php/8.3/class.regexiterator.html
RegexIterator::__construct — 新しい RegexIterator を作成する | PHP 8.3 8248
RegexIterator::__construct (PHP 5 >= 5.2.0, PHP 7, PHP 8) RegexIterator::__construct — 新しい RegexIterator を作成する 説明 public function RegexIterator::__construct ( Iterator $iterator , string $pattern , int $mode = RegexIterator::MATCH ... 表現フラグ。これらのフラグは操作モードに依存します。 RegexIterator preg_flags 操作モード 使用可能なフラグ RegexIterator::ALL_MATCHES preg_match_all() を参照ください。 RegexIterator::GET_MATCH preg_match() を参照ください。 RegexIterator::MATCH preg_match ... Iterator as $value ) { echo $value . "\n" ; } ?> 上の例の出力は、 たとえば以下のようになります。 test 1 test 123 参考 preg_match() - 正規表現によるマッチングを行う preg_match_all() - 繰り返し正規表現検索を行う preg_replace() - 正規表現検索および置換を ... 行う preg_split() - 正規表現で文字列を分割する 他のマニュアルの関連ページ Linux JM split(1) Linux JM fnmatch(3) DuckDB Regular Expressions Vim pattern Python re Linux JM creat(2) ...
https://man.mtool.work/php/8.3/regexiterator.construct.html
RecursiveRegexIterator::__construct — 新しい RecursiveRegexIterator を作成する ... 8194
RecursiveRegexIterator::__construct (PHP 5 >= 5.2.0, PHP 7, PHP 8) RecursiveRegexIterator::__construct — 新しい RecursiveRegexIterator を作成する 説明 public function RecursiveRegexIterator::__construct ( RecursiveIterator $iterator , strin ... g $pattern , int $mode = RecursiveRegexIterator::MATCH , int $flags = 0 , int $pregFlags = 0 ) 新しい正規表現イテレータを作成します。 パラメータ iterator この正規表現フィルタを適 ... 。これらのフラグは操作モードに依存します。 RegexIterator preg_flags 操作モード 使用可能なフラグ RecursiveRegexIterator::ALL_MATCHES preg_match_all() を参照ください。 RecursiveRegexIterator::GET_MATCH preg_match() を参照ください。 RecursiveRegexIterator ... ::MATCH preg_match() を参照ください。 RecursiveRegexIterator::REPLACE なし。 RecursiveRegexIterator::SPLIT preg_split() を参照くだ ...
https://man.mtool.work/php/8.3/recursiveregexiterator.construct.html
Yaf_Router::addConfig — 設定で定義したルートをルーターに追加する | PHP 8.3 7660
Yaf_Router::addConfig (Yaf >=1.0.0) Yaf_Router::addConfig — 設定で定義したルートをルーターに追加する 説明 public function Yaf_Router::addConfig ( Yaf_Config_Abstract $config ): bool 設定で定義したルートを Yaf_Router のスタックに追加します。 ... れています。 例 例1 application.ini() の例 ;the order is very important, the prior one will be called first ;a rewrite route match request /product/*/* routes.route_name.type="rewrite" routes.route_name.match="/product/:name/:value" routes.route_name.ro ... ute.controller=product routes.route_name.route.action=info ;a regex route match request /list/*/* routes.route_name1.type="regex" routes.route_name1.match="#^list/([^/]*)/([^/]*)#" routes.route_name1.ro ... =Index routes.route_name1.route.action=action routes.route_name1.map.1=name routes.route_name1.map.2=value ;a simple route match /**?c=controller&a=action&m=module routes.route_name2.type="simple" routes.route_name2.controller=c routes.route_name2.mod ...
https://man.mtool.work/php/8.3/yaf-router.addconfig.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT