extension « Regular Expression « Javascript Data Type Q&A

Home
Javascript Data Type Q&A
1.Array
2.Clojure
3.date
4.decimal
5.function
6.global
7.loop
8.math
9.number
10.object
11.Regular Expression
12.scope
13.String
14.Var
15.variable
Javascript Data Type Q&A » Regular Expression » extension 

1. Javascript regex in firefox extension    stackoverflow.com

What could be going wrong here? The problem seems to be with the regex match statement. without it the alerts come, but as soon as I put it in everything goes ...

2. Regular expression to remove a file's extension    stackoverflow.com

I am in need of a regular expression that can remove the extension of a filename, returning only the name of the file. Here are some examples of inputs and outputs:

myfile.png  ...

3. Regex to detect that the URL doesn't end with an extension    stackoverflow.com

I'm using this regular expression for detect if an url ends with a jpg :

var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*^\.jpg)/ig;
it detects the url : e.g. http://www.blabla.com/sdsd.jpg but now i want to detect ...

4. How to make regex case-insensitive?    stackoverflow.com

I have this javascript code but when i send this: asd.JPG the regex fails to me..

if (data.match(/([^\/\\]+)\.(jpg|jpeg|gif|png|tiff|tif)$/i))
     return { filename: RegExp.$1, ext: RegExp.$2 };
else
    ...

5. Validating browser upload file name and extension with simple regex    stackoverflow.com

I got the regexp right. Works perfectly for Firefox ONLY. How would i make this cross browser, cross platform manner. Since it is file name and extension validation you are right ...

6. Javascript regex for matching/extracting file extension    stackoverflow.com

The following regex

var patt1=/[0-9a-z]+$/i;
extracts the file extension of strings such as
filename-jpg
filename#gif
filename.png
How to modify this regular expression to only return an extension when string really is a filename with one ...

7. How do you write a Javascript Regex that matches if file extension is not within (exe|js|htaccess)    stackoverflow.com

I'm trying to write a javascript regexp for a blacklist of file extensions. I'm using a jquery plugin that has an option for acceptable file types that takes a regex, ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.