タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

これは微妙と正規表現に関するiwwのブックマーク (1)

  • PHPで正規表現を読みやすくする方法:phpspot開発日誌

    PHP In Action | Readable regular expressions It bothers me: I can dream up more ideas in one afternoon than I can write down in a week. PHPで正規表現を読みやすくする方法。 通常、PHPで正規表現を記述するとき、次のようにpreg_matchに直接渡して使う行うことが多いかと思います。 preg_match("/^[a-z]+$/", $str); 正規表現の内容が複雑になるにつれ、コードがよく分からなくなることはありがちですね。 そこで、次のようにコードを記述すると単位ごとにコメントが付けられて読みやすくなります。 $regex = '/(w+s+)'. // Word followed by spaces '{6}'. // Repeated six

    iww
    iww 2007/03/25
    読みにくい
  • 1