Setting $director from Regex of file location

Tags:

#1 rbpalmer2401

Hi All,

I need to change this format 'C:\logfile\directory1\directory2'

into '\logfile\directory1\directory2\'

using regex and the command

exec $directory =

this is to be able to set the destination folder the same as the location folder recursively

#2 b0ti Nxlog ✓
#1 rbpalmer2401
Hi All, I need to change this format 'C:\logfile\directory1\directory2' into '\logfile\directory1\directory2\' using regex and the command exec $directory = this is to be able to set the destination folder the same as the location folder recursively

Something like this should do what you are looking for:

Exec $directory = replace($directory, 'C:\', '\', 1);