Community

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

    Delete text with notepad ++

    General Discussion
    2
    3
    2118
    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.
    • lolo germ
      lolo germ last edited by

      Hi there !, Use notepad ++, I tried to delete text between @ and before “:”, my text is 15678 lines, the text is as follows:

      Landon@mail.com:m1234@mail.com:name1
      Caleb@mac.lt:myr@mail.com:name4
      Gavin@wichi.es:phil@ymail.com:name5

      The result that is needed is:
      Landon:m1234@mail.com:name1
      Caleb:myr@mail.com:name4
      Gavin:phil@ymail.com:name5

      How can I do this?

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

        Hello, @lolo-germ and All

        Ok ! Try to be as accurate as possible ! Indeed, you would like to delete any range of characters, between the first arrobas symbol ( @ ) of each line till the nearest colon character : excluded

        As usual, no problem with regular expressions ;-)). So :

        • Open the Replace dialog ( Ctrl + H )

        • Select the Regular expression search mode

        • Tick the Wrap around option

        SEARCH (?-s)@.+(?=:.+@)

        REPLACE Leave EMPTY

        • Click, once, on the Replace All button or several times on the Replace button

        Notes :

        • The (?-s) modifier means that dot ( . ) matches a single standard character, only ( not the EOL of a line-break )

        • Then the part @.+ tries to match an arrobas followed by the longest non-null range of any standard character

        • But, ONLY IF the positive look-ahead structure, (?=......) is TRUE. That is to say if the regex :.+@ is satisfied at the “work position” of the regex engine. In other words, if, right after, a colon character can be found and, further on, a second arrobas character, separated, from the first colon, by a non-null range of chars , .+

        • As the replacement zone is empty, the matched range of characters is just deleted

        Cheers,

        guy038

        1 Reply Last reply Reply Quote 1
        • lolo germ
          lolo germ last edited by

          very grateful to you, I’ve tried it and it works

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