Barnaby W. Füi
Elite Member
Originally posted by: igowerf
What, you don't like my method? 🙂
Why are there so many slashes and symbols....? 😕
"Regular expressions, and the perl dorks that abuse them, on the next Oprah Winfrey Show"
Originally posted by: igowerf
What, you don't like my method? 🙂
Why are there so many slashes and symbols....? 😕
Originally posted by: Tyler
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}
🙂
Originally posted by: BingBongWongFooey
Originally posted by: Tyler
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}
🙂
Can't you use #'s or commas instead of /'s, and not have to escape the /'s?
$filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
$filename =~ s,^.*[/\\]([^/\\]+)$,$1,;
Originally posted by: Tyler
Originally posted by: BingBongWongFooey
Originally posted by: Tyler
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}
🙂
Can't you use #'s or commas instead of /'s, and not have to escape the /'s?
$filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
$filename =~ s,^.*[/\\]([^/\\]+)$,$1,;
I could, but I dont. No particular reason, I'm just accustomed to doing it that way.