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:

$test1@gmail.com:Keepline1
Ga@gmail.com:Removeline0
S*556&e@yahoo.com:Removeline0
*test2@hotmail.com:Keepline1
3%6%768()-S@yahoo.fr:Removeline0
¿H£1§¥889@gmail.com:Removeline0
Normal1@web.net:Keepline1
§Studio7746@club.ru:Keepline1

need result:

$test1@gmail.com:Keepline1
*test2@hotmail.com:Keepline1
Normal1@web.net:Keepline1
§Studio7746@club.ru:Keepline1
  • You have now asked 10 questions regarding regular expressions. Are you not learning anything from the answers you have been given so far? – DavidPostill Aug 24 '17 at 8:46
  • nope i learned a lot and gived upvote to people who helped but we are live until death learning from life ? – DeathRival Aug 24 '17 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 ? – DeathRival Aug 24 '17 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 Aug 24 '17 at 9:04
  • i tryied to edit the code to match this question but i fail – DeathRival Aug 24 '17 at 9:08
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:

$test1@gmail.com:Keepline1
*test2@hotmail.com:Keepline1
Normal1@web.net:Keepline1
§Studio7746@club.ru:Keepline1
  • as always you a genius is there a way to contact you like skype or discord or fb ? – DeathRival Aug 24 '17 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.