$re = '/(│?\s{3,})*[├└]─{2} /';
$str = '├── Blog
│ └── _v_images
├── Essay
│ └── Encryption&Trust
├── Hidden
│ └── _v_images
├── Life
│ ├── Cuisine
│ ├── Game
│ ├── Ideas
│ ├── Linguistic
│ │ └── English
│ └── Music
├── Other
│ └── _v_images
├── PWN
│ └── _v_images
├── Programme
│ └── _v_images
├── Work
│ ├── Database
│ ├── GUI
│ │ └── CSS
│ ├── Language
│ │ └── DocString
│ │ └── __pycache__
│ ├── Network
│ ├── OS
│ │ ├── Android
│ │ │ ├── BuildTools
│ │ │ ├── DevTools
│ │ │ ├── Permissions
│ │ │ ├── PropertiesLogs
│ │ │ ├── Signer
│ │ │ │ ├── META-INF
│ │ │ │ └── webview
│ │ │ │ ├── META-INF
│ │ │ │ ├── assets
│ │ │ │ │ └── stored-locales
│ │ │ │ │ └── weblayer
│ │ │ │ ├── lib
│ │ │ │ │ ├── arm64-v8a
│ │ │ │ │ └── armeabi-v7a
│ │ │ │ └── res
│ │ │ │ ├── anim
│ │ │ │ ├── anim-v21
│ │ │ │ ├── animator
│ │ │ │ ├── animator-v21
│ │ │ │ ├── color
│ │ │ │ ├── color-v21
│ │ │ │ ├── color-v23
│ │ │ │ ├── drawable
│ │ │ │ ├── drawable-hdpi-v4
│ │ │ │ ├── drawable-ldrtl-hdpi-v17
│ │ │ │ ├── drawable-ldrtl-v17
│ │ │ │ ├── drawable-ldrtl-xhdpi-v17
│ │ │ │ ├── drawable-ldrtl-xxhdpi-v17
│ │ │ │ ├── drawable-ldrtl-xxxhdpi-v17
│ │ │ │ ├── drawable-night-hdpi-v8
│ │ │ │ ├── drawable-night-v8
│ │ │ │ ├── drawable-night-xhdpi-v8
│ │ │ │ ├── drawable-night-xxhdpi-v8
│ │ │ │ ├── drawable-night-xxxhdpi-v8
│ │ │ │ ├── drawable-v21
│ │ │ │ ├── drawable-v23
│ │ │ │ ├── drawable-v4
│ │ │ │ ├── drawable-xhdpi-v4
│ │ │ │ ├── drawable-xxhdpi-v4
│ │ │ │ ├── drawable-xxxhdpi-v4
│ │ │ │ ├── font
│ │ │ │ ├── interpolator
│ │ │ │ ├── interpolator-v21
│ │ │ │ ├── layout
│ │ │ │ ├── layout-land
│ │ │ │ ├── layout-v21
│ │ │ │ ├── layout-v22
│ │ │ │ ├── layout-v26
│ │ │ │ ├── menu
│ │ │ │ ├── raw
│ │ │ │ └── xml
│ │ │ └── UID
│ │ └── Linux
│ ├── Presentation
│ │ ├── Diagram
│ │ ├── Slides
│ │ │ └── images
│ │ └── Writing
│ ├── Project
│ ├── RE
│ ├── Service
│ ├── Tool
│ │ ├── Diff
│ │ ├── File
│ │ ├── Frida
│ │ │ └── scripts
│ │ ├── Git
│ │ ├── IO
│ │ ├── Shell
│ │ └── Text
│ └── Virtualization
│ └── Docker
└── 随笔
└── _v_images';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php