Community

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

    Add Charater to everyline that begins with

    Help wanted · · · – – – · · ·
    2
    3
    36
    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.
    • Clyde Parker
      Clyde Parker last edited by

      I’m trying to add + to every line that begins with 31, skips if it’s not in the begining and skips if it already has a +

      Example:

      97898795433131
      +319797831331
      3146464646463
      

      to

      97 89 87 95 31
      +31 97 97 83 31
      +31 46 46 46 31
      

      not

      97 89 87 95 +31
      ++31 97 97 83 +31
      +31 46 46 46 +31
      

      thanks

      1 Reply Last reply Reply Quote 2
      • guy038
        guy038 last edited by

        Hello, @clyde-parker and All,

        Not too difficult with regexes !

        SEARCH ^(?=31)

        REPLACE +

        • This regex will search for beginning of current line , so the virtual zero-length location, but ONLY IF  followed with the string 31

        • Then, in replacement, it will simply add the + symbol at the very beginning of current line

        Best regards,

        guy038

        1 Reply Last reply Reply Quote 3
        • Clyde Parker
          Clyde Parker last edited by

          works pretty good thank you sir!

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