Search notes:

Perl regular expressions: character ranges

use warnings;
use strict;

my $text = 'Foo-bar baz';

# It's possible to use \w in «character ranges»:
$text =~ /([\w-]+)/;
print "$1\n";        # Foo-bar
Github repository about-perl, path: /regular-expressions/character_ranges.pl

See also

Perl regular expressions

Index