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: Beginner: Re: [dani8586] extracting data between string: Edit Log



BillKSmith
Veteran

Jun 18, 2013, 6:04 AM


Views: 819
Re: [dani8586] extracting data between string

Real numbers can get tricky. Use the module Regexp::Common.

Code
use strict; 
use warnings;
use Regexp::Common qw( number );

while(<DATA>){
print $1 if /DECAY 6100006 ($RE{num}{real})/;
}
__DATA__
DECAY 6100006 7.08092110e-05 # t1 decays


UPDATE: Removed unnecessary code and fixed typo.
Good Luck,
Bill

(This post was edited by BillKSmith on Jun 18, 2013, 6:11 AM)


Edit Log:
Post edited by BillKSmith (Veteran) on Jun 18, 2013, 6:11 AM


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

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