Monday, 15 April 2013

regex - How to extract file location using Regular Expressions(VB.NET) -



regex - How to extract file location using Regular Expressions(VB.NET) -

i facing problem whereby given string contains path file , file's name , want extract path (without file's name)

for example, receive

c:\users\oopsd\projects\test.acdbd

and string want extract only

c:\users\oopsd\projects

i trying create regex match backslash followed word, followed dot followed word - match

\test.acdbd

part , replace empty string final result

c:\users\oopsd\projects

can anyone, familiar regex, help me on one? also, using regular expressions quite lot in future. there (free) programme can download create regular expressions?

are sure need using regex such simple task? how this:

dim file new io.fileinfo(" c:\users\oopsd\projects\test.acdbd") msgbox(file.directory.fullname)

regarding free programme on regex, recommend http://www.gskinner.com/regexr/ - using time. have consider alternatives, before going regex way.

regex vb.net pattern-matching

No comments:

Post a Comment