I'm trying to match any string with the regex that ends with /? and extract the string before /?
Below is my code:
$input = "boringinterestingboring/?";
if($input =~ /(.*)\/?$/) {
print "$1\n";
}
else {
print "not matched";
}
I'm trying to capture "boringinterestingboring"
using (.*)
but it's not doing that, instead it captures the whole string.
How should i get only the string before /?.
Please help.