2 Replies Latest reply on Feb 27, 2009 3:37 PM by Len Swierski-m5Cbo1

    [JS, CS3] How to find text that is NOT a paragraph return

    Level 1
      Hi all,
      This is probably an easy one, but I can't seem to get the idea. I want to search within some text and find everything EXCEPT the paragraph return. What would be the way to build that expression? Thanks for any response.
      Regards,
      Len Swierski
        • 1. Re: [JS, CS3] How to find text that is NOT a paragraph return
          Peter Kahrel Adobe Community Professional & MVP
          Search using this GREP expression: "[^\\r]"

          I don't know what you want to achieve, but you could also use "(?s).+"
          (?s) enable single-line mode, which makes the paragraph mark invisible, so to speak (and loosely formulated). (?s).+ therefore matches whole stories.

          Peter
          • 2. Re: [JS, CS3] How to find text that is NOT a paragraph return
            Level 1
            Thanks, Peter!
            I appreciate your help but I have found another solution. I am amazed at my own stupidity sometimes. You see, I do my scripting in a very lame sort of way because I have never used Javascript outside of InDesign. As such, I find myself at a disadvantage because the documentation that Adobe provides assumes that you are aware of many of the basics. Case in point: I have always had trouble manipulating strings because I NEVER KNEW that you could search and replace strings! I just could not find examples of this in the Adobe documentation. So here I was in some cases adding temporary textFrames so I could get to my strings as text contents and then removing the temporary textFrames at the end of the script. In this particular case I needed to merge several paragraphs into one paragraph. Now that I know how to search & replace strings, it is so simple to strip away all the paragraph returns (which are included in text contents). I am learning, albeit rather slowly. Thanks again.
            Regards,
            Len Swierski