Hi, got a question about regular expressions in perl.
I need to count how many slashes are in a string, so...
Code:
$path = /hi/you/crazy/.guy.**g/lol
I'll use this...
Code:
if ($path =~ m%^/.+/.+/.+/.+/.+$%) {
print 'whoa!, that directory is five levels deep, It works! (not really, help)
}
I can't find a simple to way to say ``any set of characters UNLESS it's a slash'', as the (.) counts everything, including slashes, and the /w doesn't account for other characters, ie: (*), and (.).