2

Code::blocks で PCRE を使用しているときに、いくつかの問題に直面しています。ここから PCRE をダウンロードしました。ここに記載されているすべての手順を実行しました。ただし、実行中に pcr3.dll 欠落エラーが発生します。

お使いのコンピューターに pcre3.dll が見つからないため、プログラムを開始できません。この問題を解決するには、プログラムを再インストールしてみてください。

私のコード:

#include <iostream>
#include <regex.h>
using namespace std;


 int main(){

 regex_t reg;

 string pattern = "[^tpr]{2,}";
 string str = "topcoder";

 regmatch_t matches[1];

 regcomp(&reg,pattern.c_str(),REG_EXTENDED|REG_ICASE);

 if (regexec(&reg,str.c_str(),1,matches,0)==0) {
       cout << "Match " ;
       cout << str.substr(matches[0].rm_so,matches[0].rm_eo-matches[0].rm_so) ;
       cout << " found starting at: " ;
       cout << matches[0].rm_so ;
       cout << " and ending at " ;
       cout << matches[0].rm_eo ;
       cout << endl;
  } else {
       cout << "Match not found.";
       cout << endl;
 }
 regfree(&reg);

  return 0;
 }

これを修正する方法がわかりません。何かアイデアはありますか?

PS: 上記のコードは、このチュートリアルから取得したものです。

4

1 に答える 1