use warnings; use strict; my $thing = 'foo/bar/goo'; (my $stuff) = ($thing =~ /^([^\/]+)/); print "$stuff\n"; __END__ foo
In reply to Re: Regex to get everything before first /
by toolic
in thread Regex to get everything before first /
by limzz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |