in reply to Extracting names from string

Sorry but the "different length" is not a reason not to use the substr.
Please try this:
print substr( $string , index($string,'/') + 1 , index($string,'|') - index($string,'/') - 1 );

Vlad.