Advertisement
Guest User

regex

a guest
Jun 29th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import json, os, re
  2.  
  3. #match files with extensions
  4. extChk = re.compile('\.(.){3}$')
  5.  
  6. def getData(*args):
  7.     for i in args:
  8.         if extChk.match(i):
  9.             print(i)
  10.  
  11. # rootdirpath, dirnames, filenames
  12. for a,b,c in os.walk(walkRoot):
  13.         for i in c:
  14.             getData(os.path.join(a,i))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement