(\S+) will capture one or more non-space characters, so you get your 'a/ff.pl'
$a =~ /^(\/home\/)(\W)(\S+).*$/(\W) will capture a single non word character, so it gets nothing.
$a =~ /^\/home\/(\w)/ # note the lowercase 'w'(\w) will capture a single word character. (it will go into $1 as you don't require any other captures).
cheers,
J
In reply to Re: Matching part of a path
by edoc
in thread Matching part of a path
by hweefarn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |