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: [smjenkin] Makefile regex: Edit Log



Zhris
User

Apr 11, 2011, 9:23 PM


Views: 2770
Re: [smjenkin] Makefile regex

Hi,

Not sure what you mean by lines that begin with tabs, but if you can split a string into target + prereqs up, then you can take the prereqs and split it up further using the same method e.g. in 1 regex:


Code
#!/usr/bin/perl 
use strict;
use warnings;

my $string = "Target : Prereq1 Prereq2 PrereqN";
my ($tar, @pre) = split /\s:\s|\s/, $string;

print "$tar\n";
print "$_\n" foreach (@pre);


Chris


(This post was edited by Zhris on Apr 11, 2011, 9:29 PM)


Edit Log:
Post edited by Zhris (User) on Apr 11, 2011, 9:24 PM
Post edited by Zhris (User) on Apr 11, 2011, 9:29 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