Created
February 15, 2016 05:55
-
-
Save FindHao/a4d9b081949c5ca4d972 to your computer and use it in GitHub Desktop.
匹配linux下ls -l结果中的文件名
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linux下ll命令部分结果,以文件名有引号的特殊举例: | |
``` | |
drwxr-xr-x 2 find find 4096 2月 15 13:10 "hello wo" | |
-rw-r--r-- 1 find find 0 2月 15 13:10 "list无名 fd" | |
``` | |
匹配的正则表达式 | |
``` | |
[drwx-]{10}\s+?\d{1,2}\s+?\w+?\s+?\w+?\s+?\d+?\s+?[\d\w\u4e00-\u9fa5]+?\s+?\d+?\s+?[\d:]+?\s+?(.*) | |
``` | |
同样对于ftp中的dir命令结果也是如此 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment