in reply to Extracting text from a string using regex

Your code is close but has two problems. First you do not use the g modifier in your regex, so your code runs into an endless loop. Second, your have a typo in this line:
$authentication .= $authentiction. $1. " ";
That tells me you are using my but you are not using strict! Remember, always use strict.

If you change that code to
$authentication .= $authentication. $1. " ";
all is fine.

That all boils down to
while ($str =~/authentication ?(\S+)?/g){ $authentication .= $authentiction. $1. " "; #more perlish }
or even
$authentication = join " ", $str =~ /authentication ?(\S+)?/g; #even + more perlish


holli, /regexed monk/