Re: [Boost-users] [regex] Why pattern anchored at buffer end ($)alsomatch for (\x0c)FF, (\x0d)CR
I am restarting this old thread. My Question: How to modify Boost regex library, to match perl behavior, such that, I only get pattern matches after/before \n and ignore (\x0c)FF, (\x0d)CR for $ & ^ anchored patterns ? Regards, Chandan John Maddock wrote:
Chandan Nilange wrote:
Hello John,
I not very clear.
So do you mean that -
$ & ^ matching pattern after/before any (\x0c)FF, (\x0d)CR is right PCRE /m modifier behaviour.
I believe so, but deciding what the right behaviour should be is not necessarily easy: Perl has the luxury that it controls File IO as well as regexes: in contrast Boost.Regex is designed to accept text from all kinds of sources and platforms. Most applications will in any case regard an isolated \r or \n as a line break, as well as \r\n. Likewise in what sense does a form-feed *not* start a new line? :-)
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Chandan Nilange wrote:
I am restarting this old thread.
My Question:
How to modify Boost regex library, to match perl behavior, such that, I only get pattern matches after/before \n and ignore (\x0c)FF, (\x0d)CR for $ & ^ anchored patterns ?
If you really feel changing this is the right thing to do, then a bit of trivial editing to the "is_separator" function in regex_traits_defaults.hpp would do the job. HTH, John.
Hello John,
Thanks a lot, that works for me!
Regards,
Chandan
--- John Maddock
Chandan Nilange wrote:
I am restarting this old thread.
My Question:
How to modify Boost regex library, to match perl behavior, such that, I only get pattern matches after/before \n and ignore (\x0c)FF, (\x0d)CR for $ & ^ anchored patterns ?
If you really feel changing this is the right thing to do, then a bit of trivial editing to the "is_separator" function in regex_traits_defaults.hpp would do the job.
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Hello John,
Thanks, this has solved my problem.
I am using boost library to verify regex engine built
in hardware(ASIC), hence I need to match with the
exact behaviour of hardware.
New Question
=============
I was wondering how did, you verify, the boost regex
engine?
I would be glad, if you would provide some details
(test stimuls, checker etc.) of the same.
Regards,
Chandan
--- John Maddock
Chandan Nilange wrote:
I am restarting this old thread.
My Question:
How to modify Boost regex library, to match perl behavior, such that, I only get pattern matches after/before \n and ignore (\x0c)FF, (\x0d)CR for $ & ^ anchored patterns ?
If you really feel changing this is the right thing to do, then a bit of trivial editing to the "is_separator" function in regex_traits_defaults.hpp would do the job.
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Chandan Nilange wrote:
New Question ============= I was wondering how did, you verify, the boost regex engine? I would be glad, if you would provide some details (test stimuls, checker etc.) of the same.
There are a large number of test cases in libs/regex/test/regress if that helps. John.
participants (2)
-
Chandan Nilange
-
John Maddock