2008-07-01から1ヶ月間の記事一覧

改行がある場合の正規表現

var s = "this is\na pen"; alert(s.match(/.*/); // => "this is" alert(s.match(/.*/m); // => "this is" マルチラインオプションはこの場合、無意味! alert(s.match(/(?:.|\n)*/); // => "this is\na pen" alert(s.match(/[^\x00]*/); // => "this is\na…