タグ

Regexに関するrti7743のブックマーク (2)

  • 正規表現 [Perl講座 -Smart]

    正規表現の概要 正規表現は、Perlの中で最も重宝する機能のひとつです。正規表現にはテキスト処理のための様々な機能があり、文字列の中から特定のパターンを見つけ出したり、置換したりすることができます。 正規表現の基的な使用方法 たとえば、$strという変数に格納したデータの中から、「A」で始まって途中は何があるかわからないが最後が「E」という文字列を探したい場合、次のように記述することで、条件にマッチする文字列を見つけることができます。 $str =~ /A.*E/; 上記では、ドット( . )が改行以外の1文字を表し、アスタリスク( * )がその任意の文字の0回以上の繰り返しを意味します。このように、正規表現において特殊な働きを持った文字を正規表現演算子、またはメタ文字と呼びます。また、=~ はパターン結合演算子と呼ばれ、「左辺の値から右辺の値を検索する」という意味があります。 正規表現

    正規表現 [Perl講座 -Smart]
  • Use regular expression in your C++ program

    how to use the Microsoft regular expression object in your C++ program Introduction Regular expressions provide a convenient way to specify complicated string pattern for search, replace or validate the text input. Since it is very useful, many people wrote their own library. Many libraries I found are buggy and it takes a lot of time to debug source code. However, actually you do not need to sear

    rti7743
    rti7743 2008/11/30
    毎回忘れるので入れとく
  • 1