The attached sample works properly in boost v1.30.2 but fails with a 'Memory exhausted' exception in v1.31 through v1.33.1. Is this a bug, and/or do you have any ideas on rephrasing the expression to work in boost 1.33.1? Thanks. --------------------- Kyle Alons http://www.kinook.com begin 666 regex.zip M4$L#!!0````(`!!2+38?'+8'N0$``&<#```(````=&5S="YC<'"54LMNVS 0 M/,N _V'AJ UI"VI3]P'(;@]]H7?W%@8%(Z\E`A(E4.M81I-_[Y*6W3A%"_0@ M:K'#F1TNYL+8O-JN$9:W3=/1"X<%]FG9MA_&HXL3UG?DC"W.>AONH:ZY-QX9 M2U!K8X4OM"OR!/)2NZFO[ZYOY'CT<SR*R.WY]%74T3K+#J)@; *5L;@X`6;0 MAHV8Y)E2QK9;2JFGB0R7=J6I$$2!Y'EB<^!+"1Z,C(79^]"!&5PJ>[D`[_%\ M*/:M6Y$3$Z'4;J:4D"*=WBMEIW*U[PAKI=+/FO3P6R%!N"G%=2)OTJE4:L[E M@R\_8F&L4E=*O?H;]W#[*?&+73-M>-1C=P[;*KB+K^)!,TB=].)Y_/H;5BVZ M]%-C[]#15]?4C.)W4R,_)YXST.ZY4HI'ROA-</D/O;?_I_>.S<<'[]Y]2$^6 MA?B$Y8IAPPG\AFYUAUEF&U?K"N[_`$S./[F(GFZCV9)XK/^C1E>@\+GQ0Y+C MNN313" WIQ!Y?L@1%^=!\A LEWZ"#TGTP%^N*2]!Y(WM"((2]CFV9!K['% > M$]RR->)\/NLF;"/=E9I$,.!%^'1(6V?A)7>X\0M02P,$% ````@`%W4L-B4* M`<.C" ``.6\```D```!I;G!U="YT>'3M7%]OVS80?UZ!?@<B3PZ6REVQ84#; M#$B<K<O0=5F<K ."/- 2:W.518VDDGI#/]D>]I'V%7;47\JF:-FUY#J6'A*% M.I)WO[O[\41)^>^??_O])QL]'C_J]]%+'$GV9$P"PK$DWG=QHSJN)E0@EWD$ MW6.!<@$TFB&,)&.^DXM>1H&D4X)^(UQ0%CQ_YCQUOGGZ[;-OG:^?*:%<<##! MP9@(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'X=>(3["[A<M"4;'L4J?L6Q1]1 V8:(^8WYM?EKQ4U-LRPWPR:B6683BXVU M5@"%^9:\7^N?FM3D45>OE>TD2MHD\+T-J#:7F^1]M*58V>4R\QF]49:ALL=+ MS&:TT<HZ\GDF_)U>&K;OW2[X_SX$0G>4WI.YOK^IWU:]I,%^;G,N@U#<@:>Y M',CR1I]6_!6-8R*EKY>$@02Y0&!7C;M</V;TXA&7SK&///?7",<?6.EM+S@3 MXH*#G7KKB,WG5(B87HK65_+>8'<P*('+I33QHVKA$8[&6!8L%R;/,4_7: M1Y,]74/XK+5W8&.&&/3JZPTKR[)CK-,M>\L^:!V/:@ZU"6D>MHEI+K>)Y3%@ M-;04&%;)1DM!%D)6B2*NVMZF7\EFLUY:CEL$DLPW"QCYH$Y49PGKO"O<43MR MRBAF.1//U$GJ[%,GJW-2G6S!5%8$ROQE%=59S8ZJ!<H5!JP2K"GIS)T^^9E/ MS[46XNNY5I/0N+:+QW@KA'L_GN;IWP+I)NYSI5R)1E\R)PM&W+3N!X;FZ.K) M/3EZ<B]):-%FD>OR,U,3'9A5TTC"(M#7W'W-;1;,/E\VB^RF+.\IO*?PDMR6 M*;R[#]Y-/+ZC4G[U@\18@:\&:;I&0I6MIFR=8"B*M2Z#0G05LO27";^VSV#J M_P%02P$"% `4````" `04BTV'QRV![D!``!G`P``" `````````!`" ````` M````=&5S="YC<'!02P$"% `4````" `7=2PV)0H!PZ,(```Y;P``"0`````` M```!`" ```#?`0``:6YP=70N='AT4$L!`A0`% ````@`L%$M-@P*IPFT" `` MQ6\```H``````````0`@````J0H``&]U='!U="YT>'102P4&``````,``P"E )````A1,````` ` end
Kyle Alons wrote:
The attached sample works properly in boost v1.30.2 but fails with a 'Memory exhausted' exception in v1.31 through v1.33.1. Is this a bug, and/or do you have any ideas on rephrasing the expression to work in boost 1.33.1? Thanks.
Kyle: the trick with these is to change the expression to make it as unambiguous as possible: the exception is thrown when the regex state machine visits too many states while trying to find a match and then gives it up as a lost cause rather than risking looking indefinitely. In this case the first (.*|\\n*) is superfluous since . can match \n as well, so the machine can "thrash" if it encounters a lot of whitespace. Using (?!System)* fixed the problem and brought the execution time down enormously. HTH, John.
Kyle: the trick with these is to change the expression to make it as unambiguous as possible: the exception is thrown when the regex state machine visits too many states while trying to find a match and then gives it up as a lost cause rather than risking looking indefinitely.
In this case the first (.*|\\n*) is superfluous since . can match \n as well, so the machine can "thrash" if it encounters a lot of whitespace. Using (?!System)* fixed the problem and brought the execution time down enormously.
Spot on. I didn't think it could be that simple. Thanks! Kyle
Kyle: the trick with these is to change the expression to make it as unambiguous as possible: the exception is thrown when the regex state machine visits too many states while trying to find a match and then gives it up as a lost cause rather than risking looking indefinitely.
In this case the first (.*|\\n*) is superfluous since . can match \n as well, so the machine can "thrash" if it encounters a lot of whitespace. Using (?!System)* fixed the problem and brought the execution time down enormously.
That works for the previous input file but not the attached one (which does work with the older regex lib and original expression). Kyle begin 666 input.zip M4$L#!!0````(`"D^.C:;2I0HHP@``#EO```)````:6YP=70N='AT[5Q?;]LV M$']>@7X'(D\.YLIML:% VQ1(G*[-D'59G*P#@CS0$FMSE46-I))Z13_9'O:1 M]A5VU%_*IFG9M>0FEAX<E3J2=[^[^_%$2?WOGW][O4<;/1X^Z/702QQ)]FA$ M`L*Q)-ZKN%$=%V,JD,L\@FZQ0+D`&DX11I(QW\E%SZ- T@E!OQ,N* N>/W4> M.S\^?O;TF?/#4R64"_;'.!@1`=V15,-_H#Y!$SQ%+HX$031P&>?$E6A(QOB& M,HYPX*%;ZOO0@GPF)*(?\M'DF"0*PDB<Y!HF>KWL&0Q;CLDJQ\,'\4SQ3XR6 M8!%W20%:60.%W*WP_&Z&TX&.DY..%> )$2&&87[%@@KG\L0YX^S3%'U^^$ 9 M'0D:C-!@*B29.,<4CP) A;KBA>'R>S)T!H3?4)>HZ]\E%]-Q)?5-??IL$K* M!/(7L,(HH8^J=)/,9;YI?E/G/R:^ZDRQ3__&$D P"1UCB=-V_;>GW,K)!/./ MH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:][0UG0IQQ ML%-O[;/)A H1TTO1^BY^$.D6LX-9`40NO8D'31MG:"S6LF"Q('F6>:1>^ZBR MIVL(GY7V#FS,$(.^^'K%RK+L&.MTL]ZR#[J,1S6'VH0T#]O$-)?;Q/(8L!I: M"@RK9*6E( LAJT015W5OT\]ELUDO+<<M`DGFFP6,?+!,5&<)Z[QSW+%TY)11 MS'(FGEDFJ;//,EF=DY;)%DQE1:#,7U91G=7LJ%J@G&/ 18)+2CISIZ]^YM-R MK87X6J[5)#2N;>(QWASAWH^G>?I7/+J)NUPI+T2C+9F3!2-N6O730'-TM>2> M'"VYER2T:+/(-?F!J(D.S*II)&$1:&ONMN8V"V8?'IM%ME.6MQ3>4GA);L,4 MWMRGZB8>WU(I/_]!8JS DTZ:KI%09:LI6X<8BF*M2Z<0G8<L_6/"K^XSF/I_ M4$L!`A0`% ````@`*3XZ-IM*E"BC" ``.6\```D``````````0`@```````` @`&EN<'5T+G1X=%!+!08``````0`!`#<```#*" `````` ` end
Kyle Alons wrote:
Kyle: the trick with these is to change the expression to make it as unambiguous as possible: the exception is thrown when the regex state machine visits too many states while trying to find a match and then gives it up as a lost cause rather than risking looking indefinitely. In this case the first (.*|\\n*) is superfluous since . can match \n as well, so the machine can "thrash" if it encounters a lot of whitespace. Using (?!System)* fixed the problem and brought the execution time down enormously.
That works for the previous input file but not the attached one (which does work with the older regex lib and original expression).
What do you mean by "doesn't work" ? It runs to completion just fine for me, no exceptions etc. Or do you mean it produces the wrong output? (I don't know what your specific intent was for the regex, so I can't guarentee that it's 100% identical in result). John.
What do you mean by "doesn't work" ? It runs to completion just fine for me, no exceptions etc. Or do you mean it produces the wrong output? (I don't know what your specific intent was for the regex, so I can't guarentee that it's 100% identical in result).
With the original expression in v1.31, it gives the attached output. In v1.33.1, the original expression fails with 'memory exhausted', and using (?!System)*, specifically, "(\\w+\\()(?!System)*System\\.Data\\.DataSet ... or "(\\w+\\()((?!System)*)System\\.Data\\.DataSet ... or "(\\w+\\()((?:!System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W5T<'5T+G1X=%!+`0(4`!0````(`"D^.C:; M2I0HHP@``#EO```)``````````$`( ```-L(``!I;G!U="YT>'102P4&```` /``(``@!O````I1$````` ` end
Kyle Alons wrote:
What do you mean by "doesn't work" ? It runs to completion just fine for me, no exceptions etc. Or do you mean it produces the wrong output? (I don't know what your specific intent was for the regex, so I can't guarentee that it's 100% identical in result).
With the original expression in v1.31, it gives the attached output. In v1.33.1, the original expression fails with 'memory exhausted', and using (?!System)*, specifically,
"(\\w+\\()(?!System)*System\\.Data\\.DataSet ...
or
"(\\w+\\()((?!System)*)System\\.Data\\.DataSet ...
or
"(\\w+\\()((?:!System)*)System\\.Data\\.DataSet ...
makes no replacements.
Doh!! Should have been using ((?:(?!System).)*) John.
participants (2)
-
John Maddock
-
Kyle Alons