0

hello how do i remove lines containing less than 3 letters in email before @domain since @domains containing already more than 3 letters or 3 letters i want to skip that and search before the @domain

so its s1111g@domain."anything":password lines

so the search will be before "@"domain like @gmail or @yahoo or any email

full example of file containing:

[email protected]:Keepline1
[email protected]:Removeline0
S*556&[email protected]:Removeline0
*[email protected]:Keepline1
3%6%768()[email protected]:Removeline0
¿H£1§¥[email protected]:Removeline0
[email protected]:Keepline1
§[email protected]:Keepline1

need result:

[email protected]:Keepline1
*[email protected]:Keepline1
[email protected]:Keepline1
§[email protected]:Keepline1
5
  • You have now asked 10 questions regarding regular expressions. Are you not learning anything from the answers you have been given so far?
    – DavidPostill
    Commented Aug 24, 2017 at 8:46
  • nope i learned a lot and gived upvote to people who helped but we are live until death learning from life ?
    – user677589
    Commented Aug 24, 2017 at 8:56
  • btw my questions it doesn't help me alone it help many around here so what you try to blame me for ?
    – user677589
    Commented Aug 24, 2017 at 9:02
  • I'm not trying to blame you for anything. This question however is very similar to the last question you asked. Have you tried adapting the answer to the last question using what you have learned?
    – DavidPostill
    Commented Aug 24, 2017 at 9:04
  • i tryied to edit the code to match this question but i fail
    – user677589
    Commented Aug 24, 2017 at 9:08

1 Answer 1

1

Here is a way to go:

  • Ctrl+H
  • Find what: ^(?:[^a-z@]*[a-z]){0,3}[^a-z@]*@.+(?:\R|$)
  • Replace with: EMPTY
  • Replace all

Explanation:

^           : begining of line
(?:         : start non capture group
  [^a-z@]*  : 0 or more non alphabetic or @
  [a-z]     : an alphabetic
){0,3}      : group exists from 0 up to 3 times
[^a-z@]*    : 0 or more non alphabetic or @
@           : literally @
.+          : 1 or more any character but newline
(?:\R|$)    : any kind of linebreak (\r, \n, \r\n) or end of line

DO NOT CHECK . matches newline

Result for given example:

[email protected]:Keepline1
*[email protected]:Keepline1
[email protected]:Keepline1
§[email protected]:Keepline1
1
  • as always you a genius is there a way to contact you like skype or discord or fb ?
    – user677589
    Commented Aug 24, 2017 at 9:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .