Boost regex not working inside indesign plugin

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

Hi,
If I modify by above code as below for using std::tr1::regex the I gets the same crash...and error.
void MTSTestFunctions::ParseAllMarker(std::wstring& inTextO, std::vector<MarkerInfo> &outMarkerInfoVec)
    std::wstring inText;
    inText.assign(inTextO);
    std::wstring::const_iterator start = inText.begin();
    std::wstring::const_iterator end = inText.end();
    std::tr1::wregex pattern(L"((<.*?>)|(\\[[^[].*?[^]]\\])|(\\[\\[.*?\\]\\]))");
    std::tr1::wsmatch what;
    std::tr1::regex_constants::match_flag_type flags =  std::tr1::regex_constants::match_default;
    int32 index = 0;
    try
        while(std::tr1::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 |=  std::tr1::regex_constants::match_prev_avail;
            //flags |=  std::tr1::regex_constants::match_not_bob;
    catch(std::runtime_error ex)

Similar Messages

  • VBA-script not working in InDesign

    Goal: To have text placed from Word formatted in the paragraph styles I like. I receive the text from other authors and they are formatted with standard Word paragraph style formatting.
    Two solutions:
    Format the text in Word (change paragraph styles) using VBA, place/import it and somehow make sure that InDesign uses the styles I already defined in InDesign, not the way that style is defined in Word. I can't figure out how to do this.
    Do the formatting in InDesign, using script. But the VBA-macro does not work in InDesign.
    How may I change the code in order to work in InDesign? The code should look for specific paragraph styles and change them or the style of the next paragraph.
    Sub stilSkifte()
    Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="1"
    Dim para As Paragraph
    For Each para In ActiveDocument.Paragraphs 'søk gjennom hvert enkelt avsnitt i dokumentet
       On Error Resume Next
        'INGEN MELLOMROM og overskriftene
        If para.Range.Style = "Ingen mellomrom" Then
            para.Style = "Normal"
            GoTo SisteLinje 'Gå til linja i koden som heter SisteLinje, = gå til neste avsnitt
        End If
        If para.Range.Style = "Overskrift 1" Then
            para.Style = "Tittel-små"
            GoTo SisteLinje 'Gå til linja i koden som heter SisteLinje, = gå til neste avsnitt
        End If
        If para.Range.Style = "Overskrift 2" Then
            para.Style = "Ingress"
            GoTo SisteLinje 'Gå til linja i koden som heter SisteLinje, = gå til neste avsnitt
        End If
        If para.Range.Style = "Overskrift 3" Then
            para.Style = "mellomtittel"
            GoTo SisteLinje 'Gå til linja i koden som heter SisteLinje, = gå til neste avsnitt
        End If
        'NORMAL til BYLINE
        If para.Range.Style = "Ingress" Then
            If para.Next.Style = "Normal" Then
                para.Next.Style = "byline1"
            End If
               GoTo SisteLinje
        End If
        If para.Range.Style = "byline1" Then
            If para.Next.Style = "Normal" Then
                para.Next.Style = "byline2"
            End If
               GoTo SisteLinje
        End If
       'Hvis avsnittet er i NORMAL og det neste er...
        If para.Range.Style = "Normal" Then
            '...i NORMAL endres dette til NORMAL M INNRYKK
            If para.Next.Style = "Normal" Then
                para.Next.Style = "Normal med innrykk"
            End If
            GoTo SisteLinje
        End If
    SisteLinje: Next
    End Sub
    I apriciate any suggestions!

    Thank you Kasyan, but it doesn't work as I expected it to. The InDesign style are somtimes overridden, sometimes not. It seems to have something to do with wether the Word-style is based on another Word-style or not. In addition I have my InDesign styles grouped, and when InDesign upon placing a text doesn't find the style on the top level, it imports the Word-style.
    My solution:
    Change Word-styles so they are not based upon another style
    Running the VBA-code in Word
    Placing the text using "Use InDesign style definition" for paragraph and character styles conflicts.
    Editing the imported InDesign styles so that they are based upon and equals the original InDesign style in the respective group

  • Spotlight still not working in inDesign

    Why is it that after nearly TWO years the spotlight function in the open dialogue box is still not working in inDesign? Is this some sort of sick joke from the inDesign programmers? Why can it work when in the PASTE dialogue box but not the OPEN dialogue box? I discovered this fault years ago and wrote about it in length but it has yet to be addressed.

    Thank you Daniel,
    I omitted posting that the Search box in my Systems Preferences Window used to work, so that I do know what to look for: as I type letters the preference panes whose description contains the (partial) word I am typing should be highlighted by an undimmed circle.
    Unfortunately, in my case, the behavior I have is that regardless of what I type in the Search box in my Systems Prefernces Window, no icons are ever highlighted. Indeed, I can type the complete name of a preference pane, for example 'bluetooth', and while my entire Systems Preferences Window is dimmed, neither my Bluetooth preference pane icon nor any other preference pane icon is highlighted through the use of an undimmed circle about it.
    This failure of the Search box in the Systems Preferences Window has been experienced by other people. For example in this forum, viz:
    Reindexed my HD but no Spotlight preference in Preferences
    http://discussions.apple.com/thread.jspa?threadID=876847
    Unfortunately the solution posted in the above thread was to manually delete the ~/Library/Caches/com.apple.preferencepanes.cache and ~/Library/Caches/com.apple.preferencepanes.searchindexcache files. And as I posted I've tried not only manually deleting the above two files in terminal.app, but also deleting all of my cache files through the use AppleJack 1.4.3. Neither steps have returned the Search box in my Systems Preferences Window to working order.
    Alas, I'm still looking for suggestions...

  • I updated my mac's OS to Yosemite and now my eye drop tool will NOT work inside premiere pro. Can anyone help me fix this issue?

    The eyedropper tool for selecting colors to key out or to fill text will not work inside premiere pro, this error started when I updated my mac os to yosemite.

    Hi Transportation,
    Does the error occur in OS X 10.9? If not, why not remain at OS X 10.9? Is it necessary to run OS X 10.10?
    The general rule of thumb is that when you are running software that is no longer tested or supported on a new operating system, you have to prepare for anomalies like this. You may want to install a separate bootable hard drive with OS X 10.9 on it so you can continue running that software more reliably.
    Hope that helps,
    Kevin

  • Key combination Shift+Alt+Cmd+D does not work in Indesign CC, why not?

    Key combination Shift+Alt+Cmd+D does not work in Indesign CC, why not?

    Is it assigned to something in the shortcut set you are using?

  • Linotype Decoration Pi will not work with InDesign CS6

    Linotype Decoration Pi Font will not work with InDesign CS6. If I buy a new version from the Sdobr store, will it work?

    Has the font ever worked in CS6? If not, did it work in a previous version? Did it ever work in any version of ID using your current OS version? I ask the last question because I helped someone on another forum today that had a font that did not survive migration on their Mac. In their case, the font was selectable but the application would crash exporting to PDF or printing.
    I'm using a PC. It works here.
    It is listed along with the fonts that start with D here.
    Mike

  • Adobe Staff Please Read - Tab Key Not Working in InDesign HTML5 based panel

    Tab Key Not Working in InDesign HTML5 based panel
    Instead of changing focus to next entry field when the tab key is pressed it hides the panel instead.
    UI Nightmare.

    I’m using editable text fields. When I hit tab nothing happens. Focus stays on current text field.
    Mike Baugh • Creative
    Director, Digital Production
    +1 240-662-4442 office
    +1 410-807-1633 mobile
    [email protected]<mailto:[email protected]>
    agency.discovery.com<http://agency.discovery.com/>

  • Help,My vc2003 can not work with indesign debug version

    Hello everyone, I am a new developer of Indesign plugin, recently I got the problem as follows:
    I use vc2003 to open the SDK provided project, and click F5, then selected the Indesign as the programm to load this plug-in. However Indesign did not load the plugin and further more, non of the break-points I setted in the programm worked. It was very strange!
    Any one can help me? Thank you very much!

    Thank you very much for your reply!
    I had solved the problem.
    If you just put the plugin in the app's plugin folder, the VC2003 would be unable to work with your indesign.
    In order to debug my plugin with VC2003 and indesign, I edit the file in %Documents and Settings%\%user%\Application Data\Adobe\InDesign\Version 4.0 which named PlugInConfig, copy the PlugInConfig.out and renamed it as PlugInConfig.txt and Dlelte the content then add the following lines:
    =Path
    "your custome plugin folder".
    Problem solved!:)

  • Cross-reference does not work inside the object states

    Hi All,
    I use InDesign CS5.5. I have four pages document. first three page has full for text and the fourth page has multi-state object. I am trying to insert the cross reference from the third page to the multi-state object (fourth multi-state object). when I export to SWF and click the cross-reference it does not got to the fourth state, but it goes to only on the first state. can any one help me how to add the cross-reference?
    I have tried on the other way. i have inserted the text anchor on the fourth multi-state object and tried to add cross-reference, still it does not work.
    am i doing something wrong or InDesign does not have this feature.
    please help.
    thanks.
    Regards
    Ramji V K

    @Ramji V K – Do we have a "terminology problem" here?
    Do you really mean a "Cross-Reference" or do you try to control the MultiStateObject (MSO) by a "Button" that does not work propperly?
    I did not do anything with the "Cross-Reference" feature yet, so I might be on the wrong trail…
    Uwe

  • Undo not working in Indesign CC 2014

    My indesign CC is not working with Undo. How do i fix this. Never had a problem with Indesign until now!!! Ever since I updated to Mavericks and CC2014 my indesign is whacky. Also does not update things without saving.

    That's almost always because of system or third party software that's stealing your keyboard shortcuts.
    Check System Preferences > Keyboard > Keyboard Shortcuts. Investigate third party software and browsers that may be operating at the same time.
    If necessary, set up a new user and launch InDesign in the new user to check the problem.

  • Shift commands not working in InDesign CC 2014

    All commands were working fine last week but opened up InDesign today and for some reason all the Shift-based commands are not working properly (i.e. automatically drawing 45 degree angles and proportionally resizing shapes). Working on a Macbook Pro 2012 running Yosemite 10.10.1

    That's almost always because of system or third party software that's stealing your keyboard shortcuts.
    Check System Preferences > Keyboard > Keyboard Shortcuts. Investigate third party software and browsers that may be operating at the same time.
    If necessary, set up a new user and launch InDesign in the new user to check the problem.

  • URL Mapping not working inside MOSS

    hi,
    I want to achieve broken URL redirection in old web application developed in MOSS.
    For this purpose, i have to use URL mapping inside web.config -
    For Example -
    <urlMappings enabled="true" >
        <add url="~/brokenpath" mappedUrl="/subsite/Pages/Home.aspx" />
    </urlMappings>
    I have checked that '/subsite/Pages/Home.aspx' url is not broken but still getting 404 exception.
    Similar tag is working under dev/local environment but not working in the production,
    Can anybody please let me know the problem or any configuration missing.
    Thanks in advance.

    Hi Saurabh, can you provide the actual broken path, both in your web.config as well as the absolute URL?
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Type to selection tool quick command not working in InDesign CC

    When I have the type tool selected in InDesign and hold command for the selection tool, it's not working. When I hold the command button it highlights the selection tool, but as soon as I click my mouse, it reverts back to the type tool. Also, when I change the size of my text box it does not resize the text in the box, even if I hold for a a few sec before moving the cursor.

    @Cindy – usually all 3rd party developers will provide some information for installing and uninstalling their products. First see if you can find some information on their web sites.
    Also there should be a dedicated Adobe Extension Manager app where you can look up the installed parts of InDesign. Since I do not have InDesign CC installed, I do not know exactly, but its name should be something like "Adobe Extension Manager CC".
    If you start this app it will show all parts installed with InDesign (or other apps that are installed).
    Usually at the bottom of the list are the 3rd party installed components. They do not state "Adobe Incoroprate System" as author. Never uninstall (remove) the Adobe ones!
    Here a screen grab from my German Adobe Extension Manager CS5:
    If you select one, a new option is available at the right. In my case here the "Entfernen" button ("Remove" in English).
    Uwe

  • "Place video from URL" not working in InDesign CC 9.1

    Has anyone come across why an H.264 encoded mp4 file won't embed into InDesign CC, but will in CS6? Last week I upgraded from Indesign 9.0 (where it was working) to Indesign 9.1 (where it no longer works). Specifically, I'm using the "Place video from URL" option.
    * I've tried several different servers to host the mp4 file (the servers do work). The mp4 URLs on each server do work in a browser, but not in Indesign CC.
    * I've tried placing the mp4 URL in CS6 and that works fine.
    * I've tried a coworker's Indesign CC, that didn't work.
    * I've tried making a brand new file in Indesign CC, that didn't work.
    I'm running InDesign 9.1 on Mac OS 10.8.5. It looks like Indesign 9.1 broke the "Place video from URL" Does anybody have a fix?
    matt

    Salah, thank you for the suggestion. However, when trying to paste the embed code into the "Place video from URL" field gets the following error, "The URL must start with 'http://' or 'rtmp://' and must end with a valid file extension."
    Using the embed code never worked with Indesign--even before I was having the problems with the URL placement.

  • Find and item Search not working inside custom list in sharepoint 2013

    HI,
    In Sharepoint 2013 , i configured the Search. it is working in home page search Box and Find item search box  inside custom list as well But one particualr custom list  Find an item is not working. Any clue ?Thanks in Advance
    Thanks
    sanjay pradhan  

    Hi,
    According to your description, my understanding is “find an item” search box in a custom list not work in your environment.
    As search box and “find an item” search box in your home page are working, so the search service application is working.
    Do you have any customzation to the particular custom list ?
    If No, I suggest you can full crawl the data in Central Administration ->Manage Service Application->” Search Service Application”-> Manage Content Sources” to test if it works. 
    Also, please check if you have set "Allow items from this list to appear in search results" in list settings->Advanced Setting to true
    Best Regards
    Jerry Guo
    TechNet Community Support

Maybe you are looking for

  • Reschedulig Date Problem in Planning Run

    Hello All, Need Clarification.. The Scenario: The Requirement date (OrdRes) is 13.02.2009, The planned Order generated is on 13.02.2009. Now the OrdRes Date Changed Manually to 27.01.2009. After Background MRP Run, in MD04 against the planned order,

  • Generate sequence nuumber for line items.

    Hi, Am using jdeveloper 11.1.1.6.0 I have generated a form using master detail. po_header as master and po_line as child in po_line i need to generate the sequence number. The problem am facing is If i generate using create sequence in my DB. Its wor

  • IPhoto book cover misprint

    The new version of iPhoto (9.2) duplicates the book title in the lower right of the cover. This seems not to be a dsiplay artifact, the pdf  shows it as well. This occurs on the "Simple Border" theme and one or two others. It may be the "spine" print

  • ALE distribution model - restriction for incoming distributed settings

    Hi, we plan to protect our ALE distribution model from user and external changes. User actions can be restricted using the B_ALE_* authorization objects, this works pretty well. However we've not found a way yet to do handle external changes. With ex

  • Barefeats Says 12 GB Sweet Spot on octo-core

    On their performance chart for rendering with After Effects, 12 GB of RAM beat 16. Is this likely to be true on all pro apps? When buying RAM for these machines, should we always think in multiples of 3?