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:
Regex failing

 



iphone
User

Feb 3, 2011, 1:42 AM

Post #1 of 2 (2281 views)
Regex failing Can't Post

Why is the below regex failing for the below input ?

\amss\products\76xx\wconnect\bthost\brew\statext\src\aeebtextag.c-36572;M76XXDFDCENJAD3555474RPLF.flf;//source/wconnect/bthost/brew/statext/rel/00.00.26/src/AEEBTExtAG.c - LABEL : 1

OUTPUT:-AEEBTExtAG.c(just the file name)


Code
(my $file_name) = $line =~ /;\/[^\/](.*)\s-\s/;



BillKSmith
Veteran

Feb 3, 2011, 12:42 PM

Post #2 of 2 (2268 views)
Re: [iphone] Regex failing [In reply to] Can't Post

Your sample data does not have the semicolon or the whitespace that your RE requires. Use:


Code
    (my $file_name) = $line =~ /\/([^\/]+)-/;

Good Luck,
Bill

 
 


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

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