Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Re: REXEP - the never ending quest :-)

Quote Reply
Re: REXEP - the never ending quest :-) In reply to
$string =~ /^[\w-]+\.(jpg|gif)$/i;

^ means beginning of line in string

[\w-]+
[] means anything inside.. + means one or more..
\w matches.. A-Za-z0-9_..
- just means -..

\. means '.'.. because . in regexp means any one character..

(jpg|gif) means jpg or gif.. also () puts the content in the buffer.. so you could say.. $ext = $1; and you'll get the file extension of the file..

$ means end of line in string..

i means insensitive casing.. so jpg and gif can be JPG and GIF..

Jerry Su
Subject Author Views Date
Thread REXEP - the never ending quest :-) Robert 3455 Aug 9, 2000, 6:14 PM
Thread Re: REXEP - the never ending quest :-)
jsu 3349 Aug 10, 2000, 11:04 PM
Post Re: REXEP - the never ending quest :-)
Robert 3260 Oct 28, 2000, 12:18 AM