$str =~ m|.*|s;
12
$str =~ m|^hallo\s(\w+)|s;$gefunden = $1;
man regex
QuoteRegexec performance is poor. This will improve with later releases.
int regexec(const regex_t *, const char *, size_t, regmatch_t [], int);