Skip to content

Instantly share code, notes, and snippets.

@FindHao
Created February 15, 2016 05:55
Show Gist options
  • Save FindHao/a4d9b081949c5ca4d972 to your computer and use it in GitHub Desktop.
Save FindHao/a4d9b081949c5ca4d972 to your computer and use it in GitHub Desktop.
匹配linux下ls -l结果中的文件名
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