I found a simpler one-step solution to this. You could split the string by the second delimiter, get the first part of the array, then split that item by your first delimiter and get the last part of the array.
String = 'abc@123|def'
first(split('abc@123|def','|')) = 'abc@123'
last(split('abc@123'),'@') = '123'
so, last(split(first(split('abc@123|def','|')),'@')) = 123
this post goes into more detail.