Quantcast
Channel: Adobe Community : Popular Discussions - InDesign SDK
Viewing all articles
Browse latest Browse all 78596

Boost regex not working inside indesign plugin

$
0
0

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


Viewing all articles
Browse latest Browse all 78596

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>