my $file = "apple.htm"; $file =~ s/^(.*)\.(.*)$/$1/; print "\$file = $file\n";
Explanation: The initial (.*) in s/^(.*)\.(.*)$/$1/; evaluates any string before the "." character and $1 representing this string char replaces the initial value assigned to the $file variable.
Anandatirtha
In reply to Re: Regex Problems
by Ananda
in thread Regex Problems
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |