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