in reply to Re^4: Extracting password from array
in thread Extracting password from array

You hadn't specified the arguments were regex patterns, not text.
perl -le'while(<STDIN>) { print $1 if /^$ARGV[0]:([^:]*):$ARGV[1]:/ }'
If they are actually text, then you can easily solve that for the Perl version.
perl -le'while(<STDIN>) { print $1 if /^\Q$ARGV[0]\E:([^:]*):\Q$ARGV[1 +]\E:/ }'

Using split is bit longer, but more readable.