Regex help...
Posted: 20 Oct 2016, 12:09
Hi,
I have the following string:
I know how to loop over it via RegExMatch but I need a bit of help to define the actual regex pattern...
The string consists of three paths:
1.) EED6-5BA8:\Us;e;rs -> Drive serial number + folder with semicolons in it
2.) D:\Test
3.) Storage:\A;B;C\ -> Volume label + folder with semicolons in it
All paths are separated with a semicolon as well (can't do anything against that!)
The regex should be able to capture each of these 3 paths...
I've tried:
But this doesn't work as it should :/ (limiting via .*? doesn't capture enough)
Each path could contain unicode letters (volume label + folders)!
I have the following string:
Code: Select all
EED6-5BA8:\Us;e;rs;D:\Test;Storage:\A;B;C\
The string consists of three paths:
1.) EED6-5BA8:\Us;e;rs -> Drive serial number + folder with semicolons in it
2.) D:\Test
3.) Storage:\A;B;C\ -> Volume label + folder with semicolons in it
All paths are separated with a semicolon as well (can't do anything against that!)
The regex should be able to capture each of these 3 paths...
I've tried:
Code: Select all
(^|;)(.*?:.*?(?=;.*?:|$))
Code: Select all
EED6-5BA8:\Us
;e;rs;D:\Test
;Storage:\A;B;C\