PCREを使ったCプログラミング(2)

[id:lethevert:20051212:p1]
PCREを使う際の基本的な流れと、対応するPCRE関数は、以下。

  1. 正規表現コンパイル : pcre_compile / pcre_compile2
  2. コンパイルされた正規表現を解析 : pcre_study
  3. 正規表現の情報を取得 : pcre_fullinfo
  4. 正規表現を文字列に適用 : pcre_exec / pcre_dfa_exec
  5. マッチした部分文字列を取得
    • インデックス : pcre_copy_substring / pcre_get_substring / pcre_get_substring_list
    • 名前付き : pcre_get_stringnumber / pcre_copy_named_substring / pcre_get_named_substring
  6. 部分文字列のメモリを解放 : pcre_free_substring / pcre_free_substring_list
      • -

(追記)
和訳発見。http://www.planewave.org/translations/pcre-3.4/pcre.ja.3.html