Loading ...
Sorry, an error occurred while loading the content.

RegEx - paragraph

Expand Messages
  • josealberto1975
    Hi, I have to Find/Replace paragraphs starting with Capitals letters from first letter only, to the dot at the end in last character ( .$) only (jumping dots
    Message 1 of 2 , Dec 2, 2007
    • 0 Attachment
      Hi, I have to Find/Replace paragraphs starting with Capitals letters
      from first letter only, to the dot at the end in last character (\.$)
      only (jumping dots between lines). And Wrap those paragraphs.

      Example, from 1st to 5th line and 6th only:
      "
      01 Vivamus viverra, massa quis convallis volutpat,
      02 pede nisi cursus elit, ac condimentum nisl orci
      03 in lorem. Praesent quis mi. Class aptent taciti
      04 sociosqu ad litora torquent per conubia nostra,
      05 per inceptos hymenaeos. Nullam enim. Cras in erat.
      06 Maecenas fringilla lorem sit amet nulla.
      "

      This is what I have but only Find the 6th line.
      ^[A-Z].+[a-zA-Z0-9^\.]\.$
      And I don't know how to replace it (wrap).

      Regards,
      J. Alberto
    • DZ-Jay
      ... The ^ and $ anchors match at the beginning and end of a line (or the input string) only, and the dot does not match a newline. So try this:
      Message 2 of 2 , Dec 2, 2007
      • 0 Attachment
        On Dec 2, 2007, at 03:29, josealberto1975 wrote:

        > This is what I have but only Find the 6th line.
        > ^[A-Z].+[a-zA-Z0-9^\.]\.$
        > And I don't know how to replace it (wrap).

        The ^ and $ anchors match at the beginning and end of a line (or the
        input string) only, and the dot does not match a newline. So try this:

        ^[A-Z].+[a-zA-Z0-9\n\.]\.$

        dZ.

        --
        DZ vs. The World:
        Hating anything, everything and everyone since 1996.
      Your message has been successfully submitted and would be delivered to recipients shortly.