| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"wolverine" |
| Date: |
29 Aug 2006 05:13:17 AM |
| Object: |
boost regex --- sregex_iterator -- Regular expression too big |
Hi all,
I am using sregex_iterator to parse an html file like below
//content of an html page is store in the below variable
string htmlFile;
sregex_iterator itr(htmlFile.begin(), htmlFile.end(), regExpr);
But that is throwing and std::runtime_error exception with message
"Regular expression too big". What can i do to avoid this ?
I went through http://www.boost.org/libs/regex/doc/configuration.html
and changed the variables like below
#define BOOST_REGEX_USE_CPP_LOCALE
#define BOOST_REGEX_NON_RECURSIVE
#ifdef BOOST_REGEX_BLOCKSIZE
#undef BOOST_REGEX_BLOCKSIZE
#endif
#define BOOST_REGEX_BLOCKSIZE 40960
#ifdef BOOST_REGEX_MAX_BLOCKS
#undef BOOST_REGEX_MAX_BLOCKS
#endif
#define BOOST_REGEX_MAX_BLOCKS 1024
Even after that i am getting the same error message. How can i solve
this error ?
Thanks In Advance
Kiran.
.
|
|
| User: "David Harmon" |
|
| Title: Re: boost regex --- sregex_iterator -- Regular expression too big |
29 Aug 2006 06:22:27 PM |
|
|
On 29 Aug 2006 03:13:17 -0700 in comp.lang.c++, "wolverine"
<kiran.happy@gmail.com> wrote,
I am using sregex_iterator to parse an html file like below
//content of an html page is store in the below variable
string htmlFile;
sregex_iterator itr(htmlFile.begin(), htmlFile.end(), regExpr);
But that is throwing and std::runtime_error exception with message
"Regular expression too big".
Perhaps that exception is thrown not by the code above, but rather
when regExpr itself is constructed? Perhaps it is written in some
recursive way that makes it effectively infinite? Perhaps you could
test the concept with a simpler file and expr that you know to be
small?
.
|
|
|
|
| User: "mlimber" |
|
| Title: Re: boost regex --- sregex_iterator -- Regular expression too big |
29 Aug 2006 08:21:15 AM |
|
|
wolverine wrote:
Hi all,
I am using sregex_iterator to parse an html file like below
//content of an html page is store in the below variable
string htmlFile;
sregex_iterator itr(htmlFile.begin(), htmlFile.end(), regExpr);
But that is throwing and std::runtime_error exception with message
"Regular expression too big". What can i do to avoid this ?
I went through http://www.boost.org/libs/regex/doc/configuration.html
and changed the variables like below
#define BOOST_REGEX_USE_CPP_LOCALE
#define BOOST_REGEX_NON_RECURSIVE
#ifdef BOOST_REGEX_BLOCKSIZE
#undef BOOST_REGEX_BLOCKSIZE
#endif
#define BOOST_REGEX_BLOCKSIZE 40960
#ifdef BOOST_REGEX_MAX_BLOCKS
#undef BOOST_REGEX_MAX_BLOCKS
#endif
#define BOOST_REGEX_MAX_BLOCKS 1024
Even after that i am getting the same error message. How can i solve
this error ?
Thanks In Advance
Kiran.
Not sure. You may want to ask on the Boost user list.
Cheers! --M
.
|
|
|
|

|
Related Articles |
|
|