Home Dashboard Directory Help
Search

tr1:regex has different behavior between vs2008 and vs2010 on some regular expression by Semlex


Status: 

Active


3
0
Sign in
to vote
Type: Bug
ID: 558339
Opened: 5/11/2010 3:21:44 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description



Hi ,
As described here : http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/d3d5ead8-f5a3-4b59-9d7b-5ba8c4f0ef01
I noticed a different behavior on some regular expressions betsween vs2008 sp1 and vs 2010.

With the following small test case :
const char *test = "TESTONE<TESTTWO<<TESTTHREE<TESTFOUR<<<";
char buf[4000];
memset(buf,0,4000);
std::string l_fmt("");
std::tr1::regex l_regular_expression;                    
l_regular_expression =

"^(([A-Z])|([A-Z]<[A-Z])){1,50}<<";


std::tr1::regex_constants::match_flag_type fonly = std::tr1::regex_constants::format_first_only;
*std::tr1::regex_replace(buf,
        test,
         test + strlen(test) ,
        l_regular_expression,l_fmt,fonly) = '\0';

in vs 20008 buf will contain :
TESTTHREE<TESTFOUR<<<
in vs 2010 buff will contain
TESTONE<TESTTWO<<TESTTHREE<TESTFOUR<<< , so that nothing is replaced.

Could anybody explain me which one is right

Regards ,

Sasha


Details
Sign in to post a comment.
Posted by Microsoft on 7/27/2010 at 7:55 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Semlex on 5/26/2010 at 6:11 AM
hi , did you find the problem to the solution ? Thanks
Posted by Microsoft on 5/11/2010 at 8:48 PM
Thank you for reporting this issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 5/11/2010 at 5:02 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.