1 Reply Latest reply: Oct 15, 2010 2:57 PM by [Jongware] RSS

    What the GREP? Can't find white space at beginning of paragraph

    mattaca Community Member

      I'm having an issue where my search for whitespace at the beginning of a paragraph no longer works when I use FindChangeByList.jsx. When I search using the find/change dialog box for:

       

      ^ +

       

      and replace with nothing, it works fine. But the same expression no longer works when entered as a line in my text file. No matter how many spaces it finds at the beginning of a paragraph, it leaves one there after running the script.

       

      grep    {findWhat:"^ +"}    {changeTo:""}    {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true}    //Delete spaces at the beginning of paragraphs

       

      Alternately I searched for

       

      (~b) +

       

      and replaced with nothing. Again, works fine. But when try to run it using the script, same result.

       

      grep    {findWhat:"(~b) +"}    {changeTo:"$1", changeConditionsMode:1919250519}    {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true}    //Remove spaces from the beginning of paragraphs

       

      WHAT THE GREP?! Is this a bug?

        • 1. Re: What the GREP? Can't find white space at beginning of paragraph
          [Jongware] Community Member

          Your first expression works for me ...

           

          Perhaps the line gets ignored in FindChangeList.txt; there might be a line elsewhere in that file that replaces all multiple spaces with one, leaving the single one you get to see.

           

          There seem to be lots of reasons for lines to be ignored in FindChangeList ... For example, when copying your first line, I made sure all elements between the { }, and the comment at the end, are separated by one single tab, rather than one or more spaces.