I could offfer more help if you posted a complete program, but let me try.

I am not sure what your first line is intended to do. It does not seem to make any sense. Your foreach probably should be for each line of input.

Your regular expression has two major errors. It includes a colon after the 55. This will not match any of your data lines. The expression (\S+) is in the wrong place to return the id. (It will return 23m after you fix the colon)

Your return is invalid in a main program. Use exit if the return code is important.