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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(.*\.([wW][mM][aA])|([mM][pP][3])$)
Description
Matches a file name to be either a .wma or .mp3 file. This can be used to check file uploads to make sure they are of a certain type. Substitute letters where appropriate for specific file types. To include more simply add logical 'or' (|) operator and append.
Matches
thisfile.mp3 | tH@tfile.wma
Non-Matches
whatever.exe | somethingelse.mpa | thisagain.wm3
Author Rating: Not yet rated. Pete Samwel
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: Updated
Name: Majed
Date: 5/28/2007 3:39:05 AM
Comment:
the pattern only accept first ext. i updated to ".*\.([dD][oO][cC]|[pP][dD][fF])$" it's work fine.


Title: bilbo
Name: brian
Date: 2/27/2005 11:39:16 AM
Comment:
when i tried this i needed parenthesis around the or argument (.*\.(([wW][mM][aA])|([mM][pP][3]))$)


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