Sign in to follow this  
Followers 0
Shiro

RegEx help

4 posts in this topic

hi there,

i want to copy some files from a directory to another but problem is that i don't know the path after some spesific location.

file are here:

d:\Documents\files\<?>\new\Pepsi.doc

d:\Documents\files\<?>\new\beverages_details.doc

d:\Documents\files\<?>\new\coke.doc

d:\Documents\files\<?>\new\statics.doc

but because we change <?> to some other name everyday, i am not able to copy files because of this

how can i copy files from this location to another when i don't know folder name of <?>

?


Share this post


Link to post
Share on other sites



Have i understand right: <?> is a name of (only) one folder, which changes the name everyday?

In this case you can get all related pathes with this pattern: "(?i)d:\\Documents\\files\\[^\\]+\\new\\\w+\.doc"


Best Regards BugFix  

Share this post


Link to post
Share on other sites

sorry, i could not understand it right way.

<?> is the folder name that's right but i could not understand how 'll i use that piece of code.

there is only one folder after files and before new folder. there is only one folder named <?>

?


Share this post


Link to post
Share on other sites

$pathes = _
'd:\Documents\files\OnlyOneFolder\new\Pepsi.doc' & @CRLF & _ ; only one folder for <?>
'd:\Documents\files\Two\Folders\new\beverages_details.doc' & @CRLF & _ ; two folders for <?> !!
'd:\Documents\files\One\new\coke.doc' & @CRLF & _ ; only one folder for <?>
'd:\Documents\files\One\new\statics.doc' ; only one folder for <?>

$ret = StringRegExp($pathes, '(?i)d:\\Documents\\files\\[^\\]+\\new\\\w+\.doc', 3)
_ArrayDisplay($ret)


Best Regards BugFix  

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