• Login
Community
  • Login

Add Charater to everyline that begins with

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 171 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.
  • C
    Clyde Parker
    last edited by Jan 31, 2021, 4:30 PM

    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
    • G
      guy038
      last edited by Jan 31, 2021, 5:33 PM

      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
      • C
        Clyde Parker
        last edited by Jan 31, 2021, 6:05 PM

        works pretty good thank you sir!

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