Otsuneのtwitter経由でphpspotがオススメするメールアドレスの正規表現。8:2ルールを採用したような簡便な正規表現にはてブのコメント欄が賑わっている。 「メールアドレス 正規表現」で検索すると最初に出てくるリソースに、思いっきり メールアドレスに一致する正規表現は「ありません」 なんてあって、その下に条件付きの鬼のような正規表現が紹介されている。メールアドレスの闇は深い。ヘタに触れると火傷する。 一応正確なアドレスを弾かずに、「なるべく」おかしなアドレスを弾く正規表現として $d3 = '\\d{1,3}'; $ip = join('\\.', ($d3) x 4); $ascii = '[\\x01-\\x7F]'; $domain = '([-a-z0-9]+\\.)*[a-z]+'; $mailre = "^$ascii+\\@($domain|\\\\[$ip\\\
Regular expressions are a powerful tool for examining and modifying text. Regular expressions themselves, with a general pattern notation almost like a mini programming language, allow you to describe and parse text. They enable you to search for patterns within a string, extracting matches flexibly and precisely. However, you should note that because regular expressions are more powerful, they ar
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く