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: [bktanner] Brand new to regexp question: Edit Log



ichi
User

Jul 19, 2009, 5:55 PM


Views: 7123
Re: [bktanner] Brand new to regexp question


Code
while(<>){ 
chomp;
if ( index($_ , "[") != -1 ){
@s = split /\]/;
@s1 = split /\[/,$s[0];
if ( $s1[-1] =~ /^[0-9.]+$/){
print $s1[-1] ."\n";
}
}
}

NB: not for multiple [..]s in line.


(This post was edited by ichi on Jul 19, 2009, 5:57 PM)


Edit Log:
Post edited by ichi (User) on Jul 19, 2009, 5:57 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