タグ

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

  • 正規表現/PHP入門

    ◆ 正規表現 正規表現は、入力されたデータの検証に利用されています。 一般的に Webアプリケーションでは閲覧者から入力を求めるフォームが利用されています。しかしながら、入力されたデータがアプリケーションで想定している内容であるとは限りません。正規表現のパターンマッチングでは、こうした入力されたデータの内容をチェックし、その妥当性を検証します。 ■ パターンマッチング パターンマッチングとは、検証する対象が、正規表現で記述された「パターン」に照らし合わせて、それが一致したときに「マッチする」ということになります。 例えば、http://www.scollabo.com/banban/ という URI を分解すると、 http:// -------- プロトコルスキーマ scollabo.com --- ドメイン名 banban --------- ディレクトリ名 これを正規表現で 「パター

    elielin
    elielin 2010/03/05
  • PHP 基礎編9 - 正規表現、マッチ、置き換え、ereg、eregi、eregi_replace - SAK Streets

    PHP 基礎編9 - 正規表現、マッチ、置き換え、ereg、eregi、eregi_replace ■正規表現 ・PHP では、ereg で文字列の検索や置き換えを行う。 (パターンマッチ、パターンマッチング) 大文字小文字の区別をしない場合は、eregi を使用する。 また、文字列を置き換える場合は、ereg_replace を使用する。 大文字小文字の区別をしない置き換えは、eregi_replace を使用する。 $rcd = ereg(マッチパターン, 対象変数 [, 代入配列]); |_ True 一致(マッチ数) False 不一致 $rcd = eregi(マッチパターン, 対象変数 [, 代入配列]); |_ True 一致(マッチ数) False 不一致 $rcd = ereg_replace(マッチパターン, 置換文字列, 対象変数); |_ True 一致(マッチ数)

    elielin
    elielin 2010/03/05
  • Books in the Age of the iPad

    home → journal → Books in the Age of the iPad Translations: Belorussian, Japanese, Portugese Good Riddance. As the publishing industry wobbles and Kindle sales jump, book romanticists cry themselves to sleep. But really, what are we shedding tears over? We’re losing the throwaway paperback. The airport paperback. The beachside paperback. We’re losing the dregs of the publishing world: disposable b