I have a variable with some blob of text in it
$foo = "
Garbage directory
/test/this/is/a/directory
/this/is/another/foo\nThisd is is\nDrop stuff testing\nRandom stuff emacs is great";
How do I use regex to get the line that is /test/this/is/a/directory
I tried this:
my $foo = "
Garbage directory
/test/this/is/a/directory
/this/is/another/foo\nThisd is is\nDrop stuff testing\nRandom stuff emacs is great";
$foo =~ /^\/test.*$/;
print "\n$foo\n";
But this just keeps on printing the whole blob of text.