I am looking for a solution for this in Perl.
Example: If my line is:
my $content = 'toto /app/blah titi\nhuh/app/ttt wew';
and my pattern: /app/somethingI want to get as output in an array: /app/blahand /app/ttt.
(which basically means grep -E -o '\/app\/[a-z]*')
I can not make it work! I tried:
my $content = 'toto /app/blah titi\nhuh/app/ttt wew';
$content =~ m/(\/app\/[a-z]*)/;
print "Group: $1 $2\n";
but it only prints: /app/blah(not /app/ttt)
and anyway, I don't know how to put the results in a table:
my (@table) = @_;
the table does not contain anything!
THX
source
share