Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/usr/bin/python
  2. import re
  3. f=open('/var/log/auth.log','r')
  4. while 1:
  5. line = f.readline()
  6. if not line:
  7. break
  8. m=re.search(r'(^[A-Z][a-z]{2} \d+ \d+:\d+:\d+).*user\s*=\s*(\w+)',line)
  9. print(m.group(1)+" "+m.group(2))
  10.  
  11.  
  12. #!/usr/bin/python
  13. import re
  14.  
  15.  
  16. date="<DEIN INPUT>"
  17. m=re.search('(^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$)', date)
  18. print(m.group(0))
Add Comment
Please, Sign In to add comment