Hello and welcome
have you read Serial Input Basics
Indeed if your incoming lines are ended with a \n and not too long, then indeed it's pretty easy to read in a line, and then find if "BE" is in the buffer using possibly strtok() with a space as delimiter and just testing against "BE" the next 2 chars and when found indeed do some hexa to int conversion bitwise kung-fu to build your int (2 bytes fit into an int, no need for a long) (many ways to skin that cat)
give it a try starting from Robin's Serial code and post your attempt. we will help fix the code if you have issues.