タグ

2010年3月16日のブックマーク (2件)

  • Site not found

    Your request did not find this site in the web server! Probable cause: Did not bind this domain name or IP to this site! Configuration file not in effect! How to solve: Check whether already bound to the site, if true, try reloading the Web services. Check if the port is correct. If you are using a CDN product, try clearing the CDN cache. For ordinary website visitors, please contact the webadmin.

  • おそらくはそれさえも平凡な日々: PHPの正規表現と文字列

    PHPで正規表現を扱う上で、正規表現パターンの記述で迷ってしまっている人が多い気がする。 PHPが文字列を生成する その文字列を正規表現エンジンに渡す と言う2段階の手順があり、そこがやや複雑なので混乱を招く部分があるのだと思う。 混乱を防ぐためには、その手順をしっかり追って、正規表現リテラルとして指定している文字列をechoしたらPHPがどのように出力するかを考えてみると良い。 例えば以下のようなコードがあったとする。 preg_match('/\\d/','3d'); まず、preg_match()の第一引数になっている正規表現パターンをechoで出力するとどうなるかを考える。 echo '/\\d/'; #/\d/ なので、/\d/が正規表現エンジンに渡されると分かる。なので、上記のパターンはマッチする。 さらに混乱を招きやすくしているのが、PHPの文字列の仕様で、特にバックスラッシ

    Kenji_s
    Kenji_s 2010/03/16