LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] regex(5)

[ILUG] regex(5)

admin admin at web2o.net
Wed Apr 18 15:26:18 IST 2001


I'm using a content manager system from Interwoven called Teamsite. It allows inline use of Reg-ex(5) expressions within XML documents. However the expression \.\(gif\|jpg\|jpeg\)$ does not return true.

Thanks

David

>What language are you doing this thing in? It depends on how you're 
>implenting your regex, normally you'll either get an array of some sort 
>(for example ereg/eregi in PhP) or you'll get some variables set (like perl 
>$1, $2 etc.)
>
>If it was PERL:
>
>if ($file =~ m/\.(gif|jpg|jpeg)$/i) {
>         print "Thank you $1 is a valid extension\n";
>} else {
>         die "Not a support image format\n";
>}
>
>PHP:
>
>if (eregi('\.(gif|jpg|jpeg)$',$filename,$regex)) {
>         print "Thank you ".$regex[1]." is a valid extension!\n";
>} else {
>         die("Not supported image format");
>}
>
>
>Jerry.
>
>At 09:56 18/04/01 -0400, admin wrote:
>>I've implemented the following \.(gif|jpg|jpeg)$ but it doesn't seem to 
>>return a true value on any file name I give.
>>
>>Thanks
>>
>>David
>>
>>
>> >it'd be:
>> >
>> >\.(gif|jpg)$
>> >
>> >Regards,
>> >
>> >jerry.
>> >
>> >At 09:34 18/04/01 -0400, admin wrote:
>> >>Hiya!
>> >>
>> >>I was wondering if anyone knew how to check extensions such as .gif .jpg
>> >>with regex(5) syntax ?
>> >>
>> >>Thanks
>> >>
>> >>David
>> >>
>> >>--
>> >>Irish Linux Users' Group: ilug at linux.ie
>> >>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
>> >>List maintainer: listmaster at linux.ie
>> >
>> >
>>
>>--
>>Irish Linux Users' Group: ilug at linux.ie
>>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
>>List maintainer: listmaster at linux.ie
>
>
>-- 
>Irish Linux Users' Group: ilug at linux.ie
>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
>List maintainer: listmaster at linux.ie
>




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell