Community
    • Login

    Regex help

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 222 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.
    • Luis Piña IIIL
      Luis Piña III
      last edited by Luis Piña III

      How can I put backticks around every line with words as well as end the lines with two spaces?

      On Reddit.com, using markdown, code must be between two backticks and lines can be separated by adding two spaces at of the end.

      1 Reply Last reply Reply Quote 1
      • Neil SchipperN
        Neil Schipper
        last edited by

        Try:
        “. matches newline” unchecked
        find what: ^.*\w.*$
        replace with: \`$0\` <=== 2 spaces after 2nd backtick

        Alan KilbornA 1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @Neil Schipper
          last edited by

          @Neil-Schipper

          Note that in this scenario, leaving the $ (end of line assertion) works just as well:

          find what: ^.*\w.*

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Alan Kilborn
            last edited by

            @Alan-Kilborn said in Regex help:

            leaving the $

            Hmm, for maximum clarity I should have said:

            …leaving off the $ …

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors