• Login
Community
  • Login

How do I search for an = sign at the end of the line followed by a newline char?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 820 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    IanSunlun
    last edited by IanSunlun Nov 16, 2022, 7:39 PM Nov 16, 2022, 7:38 PM

    I’m trying to do a search and replace.
    I’m trying to replace =\n with nothing (i.e. removing them).

    In the search field I’m putting
    =\n
    \=\n
    (=)\n
    and its not finding.

    How do I search for =\n ?
    (regular expression is on)

    P 1 Reply Last reply Nov 16, 2022, 7:42 PM Reply Quote 0
    • P
      PeterJones @IanSunlun
      last edited by Nov 16, 2022, 7:42 PM

      @IanSunlun ,

      When you say =\n, do you mean you want to search for three literal characters, or the equals followed by a newline?

      Because if you are trying to find equals followed by a newline, you should know that Windows CRLF files use \r\n as the newline sequence, not \n. Windows is not linux.

      Also, please read the forum FAQs about formatting posts. Based on the number of edits while I was typing this, where you are trying to show your text better, it is painfully obvious that you haven’t read those FAQs.

      ----

      Useful References

      • Please Read Before Posting
      • Template for Search/Replace Questions
      • Formatting Forum Posts
      • FAQ: Where to find regular expressions (regex) documentation
      • Notepad++ Online User Manual: Searching/Regex

      ----

      Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

      I 1 Reply Last reply Nov 16, 2022, 7:52 PM Reply Quote 2
      • I
        IanSunlun @PeterJones
        last edited by IanSunlun Nov 16, 2022, 7:54 PM Nov 16, 2022, 7:52 PM

        @PeterJones Yes, its a literal equals sign = followed by a newline (and I am on windows).
        So I guess its =\r\n … but its asking Notepad++ to search for the literal = sign I was stuck at.

        edit: Ok, now I put the \r in, it is working, it is finding the =.

        A 1 Reply Last reply Nov 16, 2022, 7:54 PM Reply Quote 0
        • A
          Alan Kilborn @IanSunlun
          last edited by Nov 16, 2022, 7:54 PM

          @IanSunlun said in How do I search for an = sign at the end of the line followed by a newline char?:

          So I guess its =\r\n …

          Or maybe =\R

          but its asking Notepad++ to search for the literal = sign I am stuck at.

          I don’t understand this part.
          To search for a literal = (the only kind I’m aware of), you just put = in the Find what box.

          Clearly there is something we are missing here…

          I 1 Reply Last reply Nov 16, 2022, 7:55 PM Reply Quote 1
          • I
            IanSunlun @Alan Kilborn
            last edited by IanSunlun Nov 16, 2022, 7:55 PM Nov 16, 2022, 7:55 PM

            @Alan-Kilborn Now that I put the \r in, it is finding the literal equals sign.
            Before I was putting =\n, it should be =\r\n as I am on Windows.

            1 Reply Last reply Reply Quote 2
            4 out of 5
            • First post
              4/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors