(log doggies) (log needs)
^\\(log (.*)[^)]\\)\\s*\\(log (.*)[^)]\\)$
It works with the exception of missing character at the end \"s\" as:
It looks like your .*
should be [^)]*
, i.e. *any number of characters that are not closing parentheses. Giving
^\(log ([^)]*)\)\s*\(log ([^)]*)\)$
Or you could fetch all instances of (log xxx)
with
while ( $s =~ /\(log ([^)]*)\)/g ) {
print $1, "\n";
}
^\(log (.*)\)\s*\(log (.*)\)$
You don't need to negate the )
.
The [^)]
eats your s
-es. Why do you need it?
my $s = '(log doggies) (log needs)';
say for $s =~ /^\(log (.*)\)\s*\(log (.*)\)$/;
Output:
doggies
needs