/usr/bin/perl /usr/bin/ /perl / perl
if ($string =~ m#(\S*/)(\S*)#) { print "Path = $1, $Filename = $2\n"; } elsif ($string =~ /(\S+)/) { print "No path, Filename = $1\n"; }
Ok thanks everyone and for ur examples;
so in my example where the inbetween: (\S*)(\S*), does this cause the regex to jump down to the next line as there is just whitepace after the first capture/match?
x
Edit: g0n - code tags
In reply to path extraction by ada
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |