#!/bin/env perl use strict; use warnings; my $target = "/index.php?prefix=/user/"; my $path = $target; # How to optimize? $path =~ s{\?.*$}{}; $path =~ s{[^/]+$}{}; print "$path\n";
In reply to How to replace in one regexp by appleii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |