タグ

正規表現に関するuk_oasisのブックマーク (2)

  • JavaScript講座 15章 JavaScriptでの正規表現

    Blog Post Featured post Industrial Vs Non Industrial Plasma Cutting Machines Continue reading Points to Note When Shopping for a Washing Machine There are different washing machines brands in New Zealand. When shopping, therefore, you need to ensure that first, you get a quality machine; a machine that will last through many years without breaking down. You check product warranties and reviews whe

  • 3. 正規表現を使う

    ここまでで、単純な正規表現をざっと見てきましたが、次は、どうやって Python の中で使うのかに話を進めましょう。 re モジュールは正規表現エンジンのインタフェースを提供し、正規表現をオブジェクト型にコンパイルして、マッチさせることを可能にします。 3.1. 正規表現のコンパイル 正規表現は RegexObject インスタンスにコンパイルされます。 このインスタンスは、パターン・マッチや文字列交換のような、様々な働きをするメソッドを持ちます。 >>> import re >>> p = re.compile('ab*') >>> print p <re.RegexObject instance at 80b4150> re.compile() に引数 flags を指定することで、特別な設定や文法の変更を実現するのに使われます。 使用可能な設定は後で見ていくことにして、ここでは例だけ

  • 1