I want to get $path from $target. How I do it in one regexp?Those are two different questions, and are likely to have different answers. I would leave it as is, but if you insist on using one regexp, I guess (haven't tried it), something like:# How to optimize?
$path =~ s/(?:[^/]*\?.*$)|(?:[^/]+$)/;
In reply to Re: How to replace in one regexp
by JavaFan
in thread How to replace in one regexp
by appleii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |