F
frytaz
Hi, I'm trying to match few strings using some pattern
for instance i have in my file
#one# some text #two# more t*xt #three#
#two# text #one# some text #three#
and in perl
....
$re =~ s/#one#/\(\.\+\?\)/;
$re =~ s/#two#/\(\.\+\?\)/;
$re =~ s/#three#/\(\.\+\?\)/;
if ($line =~ m/^$re/) {
$one = $1;
$two = $2;
$three = $3;
}
It's all right for first file line when #one# #two# #three# are in
order,
How i can check which word was it in line before replacing it by (.
+?) ??
Or maybe there is some different way to do this
Please help
Thanks
for instance i have in my file
#one# some text #two# more t*xt #three#
#two# text #one# some text #three#
and in perl
....
$re =~ s/#one#/\(\.\+\?\)/;
$re =~ s/#two#/\(\.\+\?\)/;
$re =~ s/#three#/\(\.\+\?\)/;
if ($line =~ m/^$re/) {
$one = $1;
$two = $2;
$three = $3;
}
It's all right for first file line when #one# #two# #three# are in
order,
How i can check which word was it in line before replacing it by (.
+?) ??
Or maybe there is some different way to do this
Please help
Thanks