Community
    • Login

    Search help

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 3 Posters 4.0k 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.
    • Colin WebsterC
      Colin Webster
      last edited by

      I am looking for a way to search…

      I am looking for any email addresses that match the below form my subscriber list.

      r********Y@yahoo.com

      so It would find for example

      roseyrosey@yahoo.com
      ringmebooy@yahoo.com
      rabcdefghy@yahoo.com

      what would if type in find?

      Thanks

      Col

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Colin Webster
        last edited by

        @Colin-Webster ,

        You would use regular expression search mode, using the .* sequence to “match zero or more characters”. Putting it all together, with your other requirements:

        • FIND = r.*y@yahoo.com
        • uncheck match-case
        • select regular expression mode
        • uncheck dot matches newline
        • find next / find all

        Note that my guess is that you will come back and add restrictions, because you did not fully specify your actual needs, including emails that should be left out that will match the simplistic pattern I gave you. But now that you have a starting point, and making use of the resources linked below, you might be able to tweak it to match your unstated needs.

        ----

        Useful References

        • Please Read Before Posting
        • Template for Search/Replace Questions
        • Formatting Forum Posts
        • Notepad++ Online User Manual: Searching/Regex
        • FAQ: Where to find other regular expressions (regex) documentation
        Colin WebsterC 1 Reply Last reply Reply Quote 2
        • guy038G
          guy038
          last edited by guy038

          Hello, @colin-webster and all,

          Use the regex search :

          (?i-s)r.*y@yahoo\.com

          Best Regards,

          guy038

          Colin WebsterC 1 Reply Last reply Reply Quote 0
          • Colin WebsterC
            Colin Webster @PeterJones
            last edited by

            @PeterJones

            that doesn’t work when I put in the search box

            so it r********y@yahoo.com I need to find all emails staring with r. 8 unknown characters then ending in y@yahoo.com

            Thanks

            Col

            PeterJonesP 1 Reply Last reply Reply Quote 0
            • Colin WebsterC
              Colin Webster @guy038
              last edited by

              @guy038

              I don’t understand as not done this kind of stuff before

              so it r********y@yahoo.com I need to find all emails staring with r. 8 unknown characters then ending in y@yahoo.com

              so when i do the search it brings up for example

              rhekfolwjy@yahoo.com
              rjr34nxley@yahoo.com
              ruen4b713y@yahoo.com

              all begin with r then 8 unknown characters then y@yahoo.com

              Thanks

              Col

              1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Colin Webster
                last edited by

                @Colin-Webster

                Since you said it didn’t work at all, not that it matched too many, I am going to assume you didn’t select “Regular expression” mode. That was a requirement for mine to work at all, for any definition of the phrase “to work”

                But now you’ve changed the rule (or, rather, as I predicted, you had requirements that you hadn’t stated), because you’ve said you need exactly 8 characters between. I had assumed that you meant any number of characters between, because you never said any different.

                And you didn’t bother reading any of the references I posted a link to, nor even the text I had in the actual post that I typed for you, because you didn’t try to show us ones that shouldn’t match.

                It’s almost like you don’t care about learning, and just want us to read your mind and do your homework or job for you, for free.

                • FIND = (?i-s)\br........y@yahoo.com
                • Search Mode = regular expression

                baf9c93a-0ecd-4e17-bdab-d49c1a06c846-image.png

                My screenshot was shown in “Mark” mode with “Bookmark line” to make it obvious what matches. But if you just want to FIND them instead, use the FIND tab of that same dialog.

                Also, to @guy038 you said,

                I don’t understand as not done this kind of stuff before

                He literally gave you an expression to type into the FIND box, and told you it was a regular expression (that’s what “regex” means – which he hoped would be obvious since I had already told you that you need to set it to regular expression mode). What part of his instructions did you not understand?

                Colin WebsterC 2 Replies Last reply Reply Quote 2
                • Colin WebsterC
                  Colin Webster @PeterJones
                  last edited by

                  @PeterJones

                  Thanks it worked

                  1 Reply Last reply Reply Quote 0
                  • Colin WebsterC
                    Colin Webster @PeterJones
                    last edited by

                    @PeterJones

                    How would i do this

                    the same as before but

                    r 8 unknown y@y 4 unknown then .ro

                    r********y@y****.ro

                    Thanks

                    Colin

                    PeterJonesP 1 Reply Last reply Reply Quote 0
                    • PeterJonesP
                      PeterJones @Colin Webster
                      last edited by PeterJones

                      r 8 unknown y@y 4 unknown then .ro

                      r********y@y****.ro

                      How would i do this

                      You would apply the knowledge you learned from my previous freebie solution and try to generalize it. Since . obviously matched a single character in my previous answer, using a . in your new expression anyplace you want it to match a single unknown character would work.

                      (?i-s)\br........y@y....\.ro

                      • The (?i-s) says “be case insensitive; don’t let . match newline”
                      • The \b says “match a word boundary” (hence requiring the r at the - beginning of the email, rather than just in the middle)
                      • Every . means “one character” – and because of the earlier option, it actually means “one character (not including newlines)”
                      • the \. means “match a literal dot character” – I changed to this because that will require four unknowns followed by a literal dot; y.....ro would work for that portion of the regex as well, but it would also match y12345ro, which you don’t want, so I made it more specific.

                      BTW: this is your last freebie from me. Until you start showing some effort and a willingness to learn, I cannot help you any further.

                      ----

                      Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

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