Community

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

    Replace a certain character with ENTER

    Help wanted · · · – – – · · ·
    3
    3
    1034
    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.
    • Rumi Balkhi
      Rumi Balkhi last edited by

      Hi, I have to change the following

      text text ******* text text
      text text ******* text text

      To

      text text
      text text
      text text
      text text

      Which means, replacing (*******) with an enter

      Kindly suggest a solution

      Thanks

      1 Reply Last reply Reply Quote 0
      • patrickdrd
        patrickdrd last edited by

        search -> replace

        check “search mode: extended”

        replace with: “\n” (without the quotes)

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

          Since @patrickdrd 's solution was a tad unclear, I’d suggest:

          Find: \s*\*+\s*
          Replace: \r\n for Windows-formatted file OR \n for Linux-formatted file
          Search mode: Regular Expression

          Of course, maybe the OP’s usage of * was just an example. This is unfortunate as * is a special character and needs “escaping” with \ when used in a reg exp, which just makes the whole thing appear more cryptic/complicated. :)

          1 Reply Last reply Reply Quote 4
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors