in reply to escaping newlines, regex question

You should use s|\\\\n|\n|g instead

T I M T O W T D I

Replies are listed 'Best First'.
Re: Re: escaping newlines, regex question
by hmbscully (Scribe) on Aug 24, 2001 at 00:32 UTC
    That's it!! Thank you so very much. -Wendy
      The reason is not because your regex was bad. The reason was because the text file has two literal backslashes and then an "n". The file should only have one literal backslash -- having two is kind of silly. Had the file been:
      this|that|a long\ndescription\nhere
      (where each character is a literal character), then s/\\n/\n/g would have worked.

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;