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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Match File Extension
Expression
\.([A-Za-z0-9]{2,5}($|\b\?))
Description
Pattern matches all file extensions from two(2) to five(5) characters in length (e.g. Adobe Illustrator [*.ai] or Extensible Hypertext Markup Language [*.xhtml]). Input can be an absolute path, relative path, URI, directory path, etc. If there are get variables in a URI input, they are ignored.
Matches
http://regexlib.com/Add.aspx | /path/to/filename.txt | TheSpanishInquisition.mpeg | 42.ai | Dont Panic.xhtml | http://localhost/webPage/index.php?variable=value
Non-Matches
Non-extentionFileName | FilenameWithOneCharacterExtension.q | FIlenameWithSixOrMoreCharactersExtension.invalid
Author Rating: The rating for this expression. Akoi Meexx
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