#!/usr/bin/perl use strict; use warnings; my $lol = 'Hallo'; ($lol) =~ /Hal(l)o/; my $var = 'Test'; $var =~ /W(e)lt/; if ($1) { print $1; }