RegEx Help - Match Exact Paths, How?
Posted: 14 Mar 2014 00:51
Hi, guyz.
I need to locate all occurrences of a given path in a source, say 'C:\TEMP2\xyplorer\', listing then. RegEx could be the fastest answer, but all solutions I found allow to match all 'x:\folder1\folder2', which is not what I need.
Then I need, in sequence, to replace that same string to another one. As this may or may not be achieved by the same RegEx method (but inverted), I thought it would be better place the request inline here.
>replace() is not a valid solution as it's being by far slower than regexreplace(), in such cases.
>>'C:\TEMP2\xyplorer\SUBFOLDER\(and so on, with or without files)' *may* or *may not* be of interest, so I'd like to have a method to deal with them, too, ie, reporting them AND replacing them in a later stage.
>>>those occurrences can be anywhere in source.
Thanks in advance.
I need to locate all occurrences of a given path in a source, say 'C:\TEMP2\xyplorer\', listing then. RegEx could be the fastest answer, but all solutions I found allow to match all 'x:\folder1\folder2', which is not what I need.
Then I need, in sequence, to replace that same string to another one. As this may or may not be achieved by the same RegEx method (but inverted), I thought it would be better place the request inline here.
>replace() is not a valid solution as it's being by far slower than regexreplace(), in such cases.
>>'C:\TEMP2\xyplorer\SUBFOLDER\(and so on, with or without files)' *may* or *may not* be of interest, so I'd like to have a method to deal with them, too, ie, reporting them AND replacing them in a later stage.
>>>those occurrences can be anywhere in source.
Thanks in advance.