RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find File name extractor
Expression
[^\\]+(?=(\.dwg)|(\.pdf)|(\.doc[^x]))
Description
Extract the file name from a full path string. For example, given a full path: D:\Drawing1\Drawing2\draw#1.pdf D:\Drawing1\Drawing2\draw#2.doc D:\Drawing1\Drawing2\draw#3.dwg result: draw#1, draw#2, draw#3
Matches
D:\Drawing1\Drawing2\draw#1.pdf D:\Drawing1\Drawing2\draw#1.doc D:\Drawing1\Drawing2\draw#1.dwg
Non-Matches
D:\Drawing1\Drawing2\draw#1.docx, D:\Calculations\Preview\calcsheet1.xls
Author Rating: Not yet rated. Luigi Ballotta
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials