  | 
≫  | 
 | 
  
 | 
    
      | 
    
    
    
     
HP OpenVMS HP C ランタイム・ライブラリ・リファレンス・マニュアル (下巻)
  
 
  
 文字列をパターンと照合します。
 
 
形式
#include <unixlib.h>
int decc$match_wild (char *test_string, char *string_pattern);
 
  
 
引数
 
 test_stringヌル区切り文字列のアドレス。
 
 string_pattern照合するパータンを格納した文字列のアドレス。このパターンには正規表現 (範囲 [a-z] など) だけでなく,ワイルドカード (アスタリスク (*),疑問符 (?),パーセント記号 (%)) なども含むことができます。
 
 
説明
decc$match_wildルーチンは,指定されたテスト文字列が,パータンによって指定される文字列セットのメンバであるかどうかを判断します。
 
 
戻り値
 
| 1 (TRUE)
 | 
文字列はパターンと一致します。
 | 
 
| 0 (FALSE)
 | 
文字列はパターンと一致しません。
 | 
 
 
  
 
例
 
 
/* Define as a foreign command and then provide */ 
/* two arguments: test_string, string_pattern.  */ 
 
#include <unixlib.h> 
#include <stdio.h> 
int main(int argc, char *argv[]) 
{ 
    if (decc$match_wild(argv[1], argv[2])) 
        printf("\n%s matches %s", argv[1], argv[2]); 
    else 
        printf("\n%s does not match %s", argv[1], argv[2]); 
} 
 |  
 
  
 
 
      |