Community
    • Login

    Regex help

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 442 Views 2 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors