I'm trying to parse a number out of the following string using perl (not my forte, as you can see):
Code:
Contact: 5005 <sip:5005@127.0.0.1:5062>
I need to get the "5005" part that comes directly after "Contact:"
5005 will be a different number each time (and can be any length between 4 digits and 12 digits), so I can't rely on matching to a constant.
I've tried several variations of this (For some reason, I'm terrible with regular expressions, and always have been, which is why I must ask for help on this one):
Code:
$SIPuserID=~s/\Contact:[^\n]*\n/s;
I have tried for hours with no success - can anyone help me out here?
Thanks!