Hi,
I have a text which looks something like this:
babillard (adj):taterend;babbelend;kletsend" (noun):babbelkous[m];babbelaar[m];tateraar[m];kletskous[m]"
babillarde
Question 1
I have this regular expression in my script
/^[a-z][a-z]*\s\(.*\)\:[a-z][a-z]*/ (see script below)
which I want to extract a line such as:
babillard (adj):taterend
the problem is if I ran the script through the text the output text stays empty (no output whatsoever)
Question 2
Any idea how I could proceed to extracting form my text a pattern such as this using perl
babillard (adj):taterend
billard (adj):abbelend
billard (adj):kletsend
billard (noun):babbelkous
billard (noun):babbelaar
My script
#!/usr/bin/perl
use strict;
#use LWP::Simple; check this on man
my $ligne;
my $clean;
my $pos;
my $cleaner;
my $txt;
open(FILEINPUT,"$ARGV[0]") || die "erreur de lecture de fichier :$!";
while ($ligne=<FILEINPUT>){
if ($ligne =~ /^[a-z][a-z]*\s\(.*\)\:[a-z][a-z]*/){
print "$ligne\n";
}
}
close(FILEINPUT);
I have a text which looks something like this:
babillard (adj):taterend;babbelend;kletsend" (noun):babbelkous[m];babbelaar[m];tateraar[m];kletskous[m]"
babillarde
Question 1
I have this regular expression in my script
/^[a-z][a-z]*\s\(.*\)\:[a-z][a-z]*/ (see script below)
which I want to extract a line such as:
babillard (adj):taterend
the problem is if I ran the script through the text the output text stays empty (no output whatsoever)
Question 2
Any idea how I could proceed to extracting form my text a pattern such as this using perl
babillard (adj):taterend
billard (adj):abbelend
billard (adj):kletsend
billard (noun):babbelkous
billard (noun):babbelaar
My script
#!/usr/bin/perl
use strict;
#use LWP::Simple; check this on man
my $ligne;
my $clean;
my $pos;
my $cleaner;
my $txt;
open(FILEINPUT,"$ARGV[0]") || die "erreur de lecture de fichier :$!";
while ($ligne=<FILEINPUT>){
if ($ligne =~ /^[a-z][a-z]*\s\(.*\)\:[a-z][a-z]*/){
print "$ligne\n";
}
}
close(FILEINPUT);