smacca
asked on
Regular expression required to validate a FileUpload path.
Why is the following validation expression for my RegularExpressionValidator failing on my jpg upload?
ValidationExpression="^(([ a-zA-Z]:)| (\\{2}\w+) \$?)(\\(\w [\w].*))+( .jpg|.jpeg |.gif|.bmp |.png)$"
See:
http://msdn2.microsoft.com/en-us/library/aa479405.aspx.
I changed the example shown and modified it to allow on image files.
It may be because I have incorrectly interpreted when converting expression to a single line expression from:
ValidationExpression="^(([ a-zA-Z]:)| (\\{2}\w+) \$?)(\\(\w [\w].*))
+(.mp3|.MP3|.mpeg|.MPEG|.m 3u|.M3U)$"
Any help appreciated.
ValidationExpression="^(([
See:
http://msdn2.microsoft.com/en-us/library/aa479405.aspx.
I changed the example shown and modified it to allow on image files.
It may be because I have incorrectly interpreted when converting expression to a single line expression from:
ValidationExpression="^(([
+(.mp3|.MP3|.mpeg|.MPEG|.m
Any help appreciated.
try this:
string fRegex = "^.+\.((jpg)|(gif)|(jpeg)) $";
string fRegex = "^.+\.((jpg)|(gif)|(jpeg))
try this one
ValidationExpression="^([a -zA-Z]\:|\ \)\\([^\\] +\\)*[^\/: *?'<;>;|]+ \.(jpg|jpe g|gif|bmp| png)(l)?$"
ValidationExpression="^([a
ASKER
The following validation expression is not working:
ValidationExpression="^(([ a-zA-Z]:)| (\\{2}\w+) \$?)(\\(\w [\w].*))(. jpg|.jpeg| .JPG|.JPEG )$"
ValidationExpression="^(([
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you tell me what is wrong with the first expression.
It is the one provided by Microsoft?
It is the one provided by Microsoft?
whats mod yaar..
my expression is completely right here..
i should be awarded point
my expression is completely right here..
i should be awarded point
Easiest way to find out...change the example into one line...does it still work? Then you did something else wrong, doesn't work? (which would be my first guess) then the + is probably the one causing you a headache..
Regards,
Max.