« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 394 for Match (0.002 sec.)
match 8579
« switch declare » PHP Manual 制御構造 match 検索 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
match 8579
« switch declare » PHP Manual 制御構造 match 検索 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
正規表現によるマッチングを行う 8027
« preg_last_error_msg preg_match_all » PHP Manual PCRE 関数 正規表現によるマッチングを行う 検索 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 に、マッチした文字列、 オフセット ...
https://man.mtool.work/php/8.3/function.preg-match.html
正規表現によるマッチングを行う 8027
« preg_last_error_msg preg_match_all » PHP Manual PCRE 関数 正規表現によるマッチングを行う 検索 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 に、マッチした文字列、 オフセット ...
https://man.mtool.work/php/8.3/function.preg-match.html
Yaf_Route_Regex のコンストラクタ 7441
« Yaf_Route_Regex::assemble Yaf_Route_Regex::route » PHP Manual Yaf_Route_Regex Yaf_Route_Regex のコンストラクタ 検索 Yaf_Route_Regex::__construct (Yaf >=1.0.0) Yaf_Route_Regex::__construct — Yaf_Route_Regex のコンストラクタ 説明 public fun ... ction Yaf_Route_Regex::__construct ( string $match , array $route , array $map = ? , array $verify = ? , string $reverse = ? ) パラメータ match 正規表現のパターン。リクエスト ... _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
Yaf_Route_Regex のコンストラクタ 7407
« Yaf_Route_Regex::assemble Yaf_Route_Regex::route » PHP Manual Yaf_Route_Regex Yaf_Route_Regex のコンストラクタ 検索 Yaf_Route_Regex::__construct (Yaf >=1.0.0) Yaf_Route_Regex::__construct — Yaf_Route_Regex のコンストラクタ 説明 public fun ... ction Yaf_Route_Regex::__construct ( string $match , array $route , array $map = ? , array $verify = ? , string $reverse = ? ) パラメータ match 正規表現のパターン。リクエスト ... _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 7165
« 定義済み定数 例 » PHP Manual Parle Parle pattern matching 検索 Parle pattern matching Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: [:alnum:] , [:alpha:] , [:blank:] , [:cntrl:] , [: ... 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
Parle pattern matching 7131
« 定義済み定数 例 » PHP Manual Parle Parle pattern matching 検索 Parle pattern matching Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: [:alnum:] , [:alpha:] , [:blank:] , [:cntrl:] , [: ... 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
コメント 7062
« 条件付きサブパターン 再帰的パターン » PHP Manual PCRE 正規表現構文 コメント 検索 コメント コメントは、(?# という並びにより始まり、次の閉じカッコで終わります。 カッコのネストはできません。コメント内の文字は、パターンマッチには 全く関係しま ... の中でのコメントの使い方 <?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
コメント 7027
« 条件付きサブパターン 再帰的パターン » PHP Manual PCRE 正規表現構文 コメント 検索 コメント コメントは、(?# という並びにより始まり、次の閉じカッコで終わります。 カッコのネストはできません。コメント内の文字は、パターンマッチには 全く関係しま ... の中でのコメントの使い方 <?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
PREV 1 2 3 4 5 6 7 8 9 10 NEXT