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

18860Re: regex replace

Expand Messages
  • Sheri
    Jan 17, 2009
      --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...> wrote:
      >
      > I am trying to find all extra returns in a set of files in a directory
      > and remove them.
      >
      > I use regex in one file at a time and replace (\r\n){2,} with
      > \r\n and all duplicates are gone. Then I use search disk with the
      > same two things filled in to the search and replace and nothing
      > is found ...
      >
      > I'm pretty sure I've double checked the little things ...
      > directory is correct in search disk, reg exp box is checked. What
      > am I missing? Shouldn't this be working the same in one file as
      > it does in search disk and vice verse?
      >

      It does not work the same in search disk as in a loaded document
      because NoteTab converts other formats of line breaks (Unix and Mac)
      to \r\n for viewing.

      You would probably have better luck using (\R){\2,} and replace with
      $0 instead of \r\n. This way files that use Unix or Mac line breaks
      will still use them and there won't be a mix of e.g., lone \n and
      \r\n's you used to replace multiples.

      Regards,
      Sheri
    • Show all 2 messages in this topic