#!/usr/bin/perl use strict; use warnings; chomp( my $user_char = ); my $regex = '[a-z' . quotemeta($user_char) .']+'; $regex = qr{ ^ $regex $ }x; print $regex, $/; while ( my $line = ) { if ( $line =~ $regex ) { print "ja: $line\n"; } else { print "ne: $line\n"; } } # __DATA__ string.print string_print