How to extract a certain text from lines with notepad?



  • How are you friends ?, I hope that well, I hope you can help me I have a txt with 12678 lines and I need to separate
    the email with your address, the lines are like this
    email:addresss
    fami67@makil.com:avstree568 — -phonenumber 455678 number
    johon@yahoo.com:bernu34 4567ytru http://www.
    hasmnin@hotmail.com:californiaUD direction http://www. 5903
    .
    .
    .
    .

    The result I need is:

    fami67@makil.com:avstree568
    johon@yahoo.com:bernu34
    hasmnin@hotmail.com:californiaUD

    I await your prompt reply
    Thank you



  • Hello, @ani-rodet,

    Please, before trying to " think regex ", anyone should get into the habit of expressing its problem, in natural language, first, taking into account all its data ;-))

    In your case, you want to : delete the ending part of each line, beginning with the first space character of that line

    Then, the regex equivalent is quite easy to find out !

    SEARCH (?-s)\h.+

    REPLACE Leave EMPTY

    Notes :

    • As usual, the (?-s) modifier means that the dot . will match a single standard character, only ( not EOL ones )

    • Then, \h matches any horizontal blank character ( the space char \x{0020}, the tabulation char ( \x{0009} and the no-break space character \x{00a0} )

    • The final part .+ matches any non-null range of standard characters, after the horizontal blank char, till the end of each line

    • As the data matched have to be deleted, the replacement zone must stay empty

    Best Regards

    guy038



  • @ani-rodet

    This post looks very similar to this thread created by you. I think that if you post again with such questions, you should also show us WHAT YOU TRIED ON YOUR OWN before you posted. Otherwise it simply seems like the people supporting this Community are just doing your work for you (instead of giving you hints/help) and you should pay them for that help.

    And “I await your prompt reply” in such a context…is offensive.


Log in to reply