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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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