Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Regex help

    Help wanted · · · – – – · · ·
    3
    4
    53
    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 III
      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 Schipper
        Neil Schipper last edited by

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

        Alan Kilborn 1 Reply Last reply Reply Quote 1
        • Alan Kilborn
          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 Kilborn 1 Reply Last reply Reply Quote 1
          • Alan Kilborn
            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
            Copyright © 2014 NodeBB Forums | Contributors