Community
    • Login

    Find character ranges across multiple lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 337 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.
    • Kandice FelicianoK
      Kandice Feliciano
      last edited by

      My txt file has a lot of lines, each line can be any format.
      How to find email addresses in the form of : abc@abschool.com , bca@school.yahoo.ca , or abc@newyork.sjshschool.email.ca … It could be another email address. I need the result that the emails have a domain that contains " school ". What am I going to do? Thanks

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Kandice Feliciano
        last edited by

        @Kandice-Feliciano

        So if your text is like this:

        My txt file has a lot of lines, each line can be any format.
        How to find email addresses in the form of : abc@abschool.com , bca@school.yahoo.ca , or abc@newyork.sjshschool.email.ca … It could be another email address. I need the result that the emails have a domain that contains " school ". What am I going to do? Thanks
        

        I would do this:

        Do a Mark (Ctrl+m) operation like this:

        ca01c02f-ac91-49af-b636-f4082f4d1126-image.png

        Then press Copy Marked Text and paste into a new tab:

        abc@abschool.com
        bca@school.yahoo.ca
        abc@newyork.sjshschool.email.ca
        

        Do another Mark operation like this:

        6e064641-6282-4e22-8ba1-790bb2db8a3e-image.png

        Then right-click in the margin below the blue ball to get this menu:

        7e362e2a-f142-4830-af7e-cb17c8dd4467-image.png

        and choose Copy Bookmarked Lines.

        Now you have in the clipboard all of your email addresses with “school” in them.

        There are other ways; although I’m trying to “keep it simple”.

        1 Reply Last reply Reply Quote 2
        • Kandice FelicianoK
          Kandice Feliciano
          last edited by

          Thank you for your quick help. It is true that I have applied your way. But there are some lines that contain " school " that are also selected. While I just want to get email results that contain a domain that contains “school.” I’m sorry I’ve asked incomplete questions.

          1 Reply Last reply Reply Quote 1
          • Kandice FelicianoK
            Kandice Feliciano
            last edited by

            For example:
            school@yahoo.com
            abc@gmail.com, shools are there…
            These 2 lines are also selected, although I do not want to.
            That’s what I want to present.

            Alan KilbornA 1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn @Kandice Feliciano
              last edited by

              @Kandice-Feliciano

              It seems like you could change the original second Mark above to:

              60770e39-6320-4e87-ab3a-f3230792973c-image.png

              1 Reply Last reply Reply Quote 2
              • Kandice FelicianoK
                Kandice Feliciano
                last edited by

                Exactly. That’s great. Thanks

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

                  Hello, @kandice-feliciano, @alan-kilborn and All,

                  I initially thought of a regex, a bit more strict, regarding the e-mail address definition :

                  SEARCH (?-i)\b\w([\w.]*)@[\w.]*school[\w.]*\.\w{2,}\b


                  However, the Alan’s regex is more elegant. And I think that we may combine the two Mark operations in one step, with the following syntax :

                  SEARCH / MARK (?-i)\S+@\S*school\S+

                  Test it, against this text :

                  abc@newyork.sjshschl.email.ca
                  abc@abschool.com
                  abc@abschol.com
                  bca@school.yahoo.ca
                  school@yahoo.com
                  abc@newyork.sjshschool.email.ca
                  bca@schoool.yahoo.ca 
                  abc@gmail.com, shools are there…
                  
                  abc@newyork.sjshschl.email.ca, abc@abschool.com, abc@abschol.com, bca@school.yahoo.ca, school@yahoo.com, abc@newyork.sjshschool.email.ca, bca@schoool.yahoo.ca,  abc@gmail.com, shools are there…
                  

                  Best Regards,

                  guy038

                  1 Reply Last reply Reply Quote 2
                  • Kandice FelicianoK
                    Kandice Feliciano
                    last edited by

                    Thank you both. Thanks to the above 2 syntax I can rely on it to find any email address with a domain that I need. Since I very often use it to find emails on drive D or E. Previously this work took me quite a lot of time and trouble. Once again thank you 2

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