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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Parse file path
Expression
^(?<1>.*[\\/])(?<2>.+)\.(?<3>.+)?$|^(?<1>.*[\\/])(?<2>.+)$|^(?<2>.+)\.(?<3>.+)?$|^(?<2>.+)$
Description
Parses any file path and extracts directory, file name and extension separately.
Matches
d:\Program Files\Hello.txt | /home/Hello.txt | Hello.txt | .\Hello
Non-Matches
\\Hello\ | Hello\\
Author Rating: Not yet rated. Tim
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

Title: Matches extensions containing spaces
Name: Dizzypointed
Date: 2/12/2010 3:02:01 AM
Comment:
The exp matches "C:\test1\test2.aspx jh". Returning "aspx jh" as the ext.


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