Benchmarking Regular Expressions: [1 2 3]
Other Examples 1: 'b R .*v(i|1|\||l)(a|4|@)gr(a|4|@).*' 2: 'b R .+v(i|1|\||l)(a|4|@)gr(a|4|@).+' 3: 'b R \bv(i|1|\||l)(a|4|@)gr(a|4|@)\b' 4: 'b R v(i|1|\||l)(a|4|@)gr(a|4|@)' Testing each regex against each line: PASS PASS FAIL PASS Subject: Fwd: All Pills Stocked. X|A|Nax , v|agr@ # V.a.lium , V1cod\in Pnt.e.rmin = |Soma| ddgykhehezej PASS PASS PASS PASS Subject: Fwd: Got V|cod|:n & xana_x_ & v|@grA ? Va.l.ium Pnterm/i/n ~ Som|a| ipfumjuvnzls PASS PASS PASS PASS Your choices: ? |XANAX| ~ +Soma+ ` Pnterm.i.n ' v|@grA + .V.alium > At'|v@= FAIL FAIL FAIL FAIL IBbUv4oLdFbJ2JXt8NPYNrhHhfLkCLSUiyg9fJICZDFour/atgRktkw9WaW/RX6TDUuCl5GZlsTi PASS PASS FAIL PASS <img src="http://www.greatspecials.net/images/viagra1.jpg" border="0"> Starting iterations: Benchmark: timing 75000 iterations of Rule 1, Rule 2, Rule 3, Rule 4... Rule 1: 5 wallclock secs ( 4.19 usr + 0.00 sys = 4.19 CPU) @ 17899.76/s (n=75000) Rule 2: 12 wallclock secs (12.24 usr + 0.00 sys = 12.24 CPU) @ 6127.45/s (n=75000) Rule 3: 7 wallclock secs ( 6.60 usr + 0.00 sys = 6.60 CPU) @ 11363.64/s (n=75000) Rule 4: 3 wallclock secs ( 2.96 usr + 0.00 sys = 2.96 CPU) @ 25337.84/s (n=75000)
1: 'b R p.*r.*e.*s.*c.*r.*i.*p.*t.*i.*o.*n' 2: 'b R \w(5|s)cr(1|i|\||l)pt\w' 3: 'B R Prescription' Testing each regex against each line: PASS FAIL FAIL your p<celsius>re<dais>s<booby>c<congenital>rip<derate>t<fogarty>ion me PASS PASS PASS <li><font face="Arial, Helvetica, sans-serif">No Prior Prescription needed</font></li> FAIL FAIL FAIL <script language='JavaScript' SRC='http://spamsite.co.kr/js/ShortCut.js'> PASS FAIL FAIL NA<font style=font-size:1px>I</font>ME R<font style=font-size:1px>F</font>X Prescri<font style=font-size:1px>9</font>pti<font style=font-size:1px>P</font>ons<BR> Starting iterations: Benchmark: timing 75000 iterations of Rule 1, Rule 2, Rule 3... Rule 1: 14 wallclock secs (13.19 usr + 0.01 sys = 13.20 CPU) @ 5681.82/s (n=75000) Rule 2: 17 wallclock secs (16.78 usr + 0.00 sys = 16.78 CPU) @ 4469.61/s (n=75000) Rule 3: 1 wallclock secs ( 1.20 usr + 0.00 sys = 1.20 CPU) @ 62500.00/s (n=75000)