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)

Jerry Walsh jerry at aardvark.ie
Wed Apr 18 15:25:49 IST 2001


Don't escape them! let them be free to do their groovy regex things - you 
need the ()'s and the pipe unescaped..

The brackets because you want to capture the return value for that expression
and the pipe for OR.

The period (.) does need to be escaped since it will otherwise act as 'any 
character'.

If you use the expression with the brackets and pipes escaped then it'll 
only be true if your file is named something like:

mypicture.(gif|jpg|jpeg)

literally i.e. brackets etc. included as part of the filename - and you 
don't want that!

I love regex :>

Jerry.

At 15:17 18/04/01 +0100, you wrote:
>On Wed, 18 Apr 2001, 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.
>
>it's probably
>
>\.\(gif\|jpg\|jpeg\)$
>
>that you want.
>
>Good Luck,
>Mark
>
>
>--
>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