|
Boost : |
From: Mayo (g17mayo_at_[hidden])
Date: 2001-06-07 06:28:44
--- In boost_at_y..., John Maddock <John_Maddock_at_c...> wrote:
>
> >The problem I am facing is that although I use regex_match()
> >similarly with the example in the documantation, it seems that
> >regex_match() returns always false.
>
> In which case it is not finding a match: the most likely senario is
that
> there is something wrong with your regular expression: can please
give an
> example of the regex used, and an actual message that you think it
should
> match (not generalisations).
>
>
> - John Maddock
> http://ourworld.compuserve.com/homepages/john_maddock/
Hi,
Thanks for your reply.
This is the piece of code I have wrote
---------------------------------------------------------------------
bool __fastcall CDecoder::MatchCheck( char *message )
{
using namespace boost;
const char *e_string = DlgFilter->CreateRegEx().c_str();
regex match_exp(e_string);
cmatch what;
if ( regex_match(message, what, match_exp, match_default) )
{
return true;
}
else
{
return false;
}
}
//DlgFilter->CreateRegEx() returns an AnsiString of this format:
"tx_seq_num = 3"
A message that contains the above field looks exactly like the
following:
tx_seq_num = 3
ack_seq_num = 2
active_link_flag = 1
packet_stored_flag = 0
to_device_type = 2
to_device_number = 21
from_device_type = 1
from_device_number = 11
packet_type = 1
packet_sub_type = 0
packet_service_type = 0
Even If I replace the line: 'regex match_exp(e_string);' with
'regex match_exp("tx_seq_num = 3");' I still don't get no matches
I am developing the application using Borland C++ 4.0
Any ideas?
Thanks again for your time
Regards,
George
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk