in reply to Regex to get everything before first /
use warnings; use strict; my $thing = 'foo/bar/goo'; (my $stuff) = ($thing =~ /^([^\/]+)/); print "$stuff\n"; __END__ foo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex to get everything before first /
by limzz (Novice) on Jun 06, 2011 at 19:05 UTC |