So let's see what this does:
$z= $0; # store the name of the script in $z $z=~ s{.* # anything, greedy match / # then a / (the last one in $z as the match is greedy) }{}x; # removed
So this snippet just returns the basename of the script.
And as you see you can also use brackets like { } as delimiters, and the x modifier lets you comment the regexp.
In reply to Re: quite weird regexp
by mirod
in thread quite weird regexp
by larsen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |