CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [Jeff29] Regex failing: Edit Log



Zhris
Enthusiast

Dec 17, 2010, 4:08 PM


Views: 2024
Re: [Jeff29] Regex failing

Use a character class instead, and include the ".". Probably a good idea to place an $ anchor on the end of the expression too.


Code
print "$1\n" if ($line =~ /\/([\w\.]+\.txt)$/);


Chris


(This post was edited by Zhris on Dec 17, 2010, 4:11 PM)


Edit Log:
Post edited by Zhris (Enthusiast) on Dec 17, 2010, 4:09 PM
Post edited by Zhris (Enthusiast) on Dec 17, 2010, 4:10 PM
Post edited by Zhris (Enthusiast) on Dec 17, 2010, 4:10 PM
Post edited by Zhris (Enthusiast) on Dec 17, 2010, 4:11 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives