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: Intermediate: Re: [pgovind] Help with string: Edit Log



Laurent_R
Veteran / Moderator

Apr 14, 2014, 10:16 AM


Views: 9308
Re: [pgovind] Help with string

Your task can be done really easily with a very simple regex:


Code
my $field_start; 
$field_start = $1 if $field = ~ /^(\d+:\d+:\d):/;


Edit: Sorry, small mistake, the pattern should really be:

Code
$field_start = $1 if $field = ~ /^(\d+:\d+:\d+):/;



(This post was edited by Laurent_R on Apr 14, 2014, 1:20 PM)


Edit Log:
Post edited by Laurent_R (Veteran) on Apr 14, 2014, 1:18 PM
Post edited by Laurent_R (Veteran) on Apr 14, 2014, 1:20 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