Sign in to follow this  
Followers 0
gruntydatsun

Regular Expression to Extract File Paths From A String

4 posts in this topic

Hello,

If there are any regex experts reading, could I please get to make a regex that will extract valid file paths from a long string full of file paths. The file paths may include spaces.

I am doing a dir of a folder into a variable using the /b switch then I'm trying to extract the file paths, including file names, into an array.

Share this post


Link to post
Share on other sites



Something like that?

#include <Array.au3>
#include <Constants.au3>
Global $run = Run(@ComSpec & " /c dir /b /a-d ", @SystemDir, @SW_HIDE, $STDOUT_CHILD)
Global $lines
While 1
    $lines &= StdoutRead($run)
    If @error Then ExitLoop
Wend
$aContent = StringSplit(StringStripCR($lines), @LF)
_ArrayDisplay($aContent)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Thanks UEZ. Looks like I was trying to peel a potato with a swiss army knife, instead of a potato peeler. :graduated:

Share this post


Link to post
Share on other sites

See if you can help

Ciao.


apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0