Hi, While i was writing the below code in a separate project inside visual studio express, It works fine!
Now when I am using the same code in a Adobe InDesign plugin then boost::regex_search fails..
I am not getting the exact reason...
Any idea for resolving this will be great help.
void MTSTestFunctions::ParseAllMarker(std::wstring& inText, std::vector &outMarkerInfoVec)
{
std::wstring::const_iterator start = inText.begin();
std::wstring::const_iterator end = inText.end();
boost::wregex pattern(L"((<.*?>)|(\\[[^[].*?[^]]\\])|(\\[\\[.*?\\]\\]))");
boost::wsmatch what;
boost::match_flag_type flags = boost::match_default;
int32 index = 0;
try
{
while(boost::regex_search(start, end, what, pattern, flags))
{
MarkerInfo tmpMarkerInfo;
tmpMarkerInfo.mMarkerText.assign(what[0]);
tmpMarkerInfo.mStartIndex = (what.position() + index);
index += what.position();
tmpMarkerInfo.mEndIndex = (index += what.position());
tmpMarkerInfo.mMarkerTextLength = (index + what.length());
index += what.length();
// update search position:
start = what[0].second;
// update flags:
flags |= boost::match_prev_avail;
flags |= boost::match_not_bob;
}
}
catch(std::runtime_error ex)
{
}
}
Thanks