
Zhris
User
Apr 11, 2011, 9:23 PM
Views: 1727
|
|
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:
#!/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)
|