- or download this
$username =~ /(cyc(\|\/)(.*?)/;
- or download this
($username) = $ENV{REMOTE_USER} =~ /cyc(?:\\|\/)(.+)/;
($username) = $ENV{REMOTE_USER} =~ /cyc[\/\\](.+)/;
# And to cleanup a little
($username) = $ENV{REMOTE_USER} =~ m{cyc(?:\\|/)(.+)};
($username) = $ENV{REMOTE_USER} =~ m{cyc[/\\](.+)};
- or download this
perl -e 'my ($a,$b) = split("\\|/","a/b"); print "a:$a\nb:$b\n"'
a:a/b
b:
- or download this
perl -MO=Deparse -e 'my ($a,$b) = split("\\|/","a/b");'
my($a, $b) = split(m[\|/], 'a/b', 3);
...
perl -e 'my ($a,$b) = split("\\|/","a|/b"); print "a:$a\nb:$b\n"'
a:a
b:b