If the data after the first pipe is always a series of one or more digits, then you could simplify with:
^.*?\|\h*(\d+).*
No need to trim.
This also:
- Allows for null (nothing) before the first pipe.
- Allows for any amount of horizontal whitespace (including none) after the first pipe.
For details, paste the RegEx pattern and example data into Regex101.com