For a regex solution, this is a bit simpler and requires no return:
m/(handle|chat_identifier):([^:&]+)/
Note the small difference: yours allows you to use single colons within the value, I don't (it stops on the first collision). If this is not a problem, you can use my option. Or, as I mentioned in the comment, divide by : and use the fourth element in the result.
The equivalent version, which stops only with double colons, is this:
m/(handle|chat_identifier):((?:(?!::|&).)+)/
Not so pretty, but he still avoids going back (looking might slow things down though ... you will need to profile this if speed is at all important).
source share