[Bug #1148] CGI::prettyの正規表現の改良


#1

Bug #1148: CGI::prettye$B$N@55,I=8=$N2~NIe(B
http://redmine.ruby-lang.org/issues/show/1148

e$B5/I<<Te(B: Takeyuki F.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Takeyuki F., e$B%+%F%4%je(B: lib, Target version:
1.9.2
ruby -v: ruby 1.9.1p5000

IRCe$B$N@.@%$5$s$h$j!e(B
gsub(/<(?:.|\n)?>(?!\n)/, \0\n)
e$B$Oe(Bstripe$B:Q$_$J>l9g$Ke(Bstack overflowe$B$9$k>l9g$,$"$k!#e(B
gsub(/<[.\n]
?>(?!\n)/, \0\n)e$B$H$+e(B
gsub(/<.*?>(?!$)/m, \&\n)e$B$K$9$kI,MW$,$$k!#e(B


#2

e$B%A%1%C%He(B #1148 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BAssignede$B$KJQ99e(B

e$B$3$l$I$&$J$j$^$7$?!)e(B
lines = string.gsub(/(?!\A)<.?>/m, \n\0).gsub(/<.?>(?!\n)/m,
\0\n)
e$B$,0lHV%7%s%W%k$G$+$DM}6~$N>e$G$OF1$80UL#$G$9$,!#e(B

http://redmine.ruby-lang.org/issues/show/1148


#3

e$B%A%1%C%He(B #1148 e$B$,99?7$5$l$^$7$?!#e(B (by Takeyuki F.)

e$B$=$N$&$A$K%Q%C%A$rEv$F$h$&$H;W$C$F$$$^$7$?!#e(B
e$B$;$+$5$l$?$N$G6a$$$&$A$KEv$F$^$9!#e(B

http://redmine.ruby-lang.org/issues/show/1148