Extract the Pattern

Hello All,
can anyone help me out in extracting the pattern from a file...

The Input file is:

NFS B.11.11 ONC/NFS; Network-FileSystem,InformationServices,Utilities|123
NParProvider B.11.11.01.04.01.01 nPartition Provider|456
NPartition A.01.02 Enhanced NPartition Commands/789
Networking B.11.11 HP-UX_Lanlink_Product|1111
NisLdapServer B.04.00.02 The NIS/LDAP Gateway (ypldapd)|2222

I need to extract the pattern ypldapd from the fifth line which is enclosed between the brackets.. I need a script in ksh

Thanks in Advance

sed '/NisLdapServer/!d;s/.*Gateway (\(.*\))|.*/\1/' your_file

or

sed '1,4d;s/.*Gateway (\(.*\))|.*/\1/' your_file

Thanks Lorcan.. Can ya explain me the code?

The first part of the sed statement is to extract the line containing the pattern, So 1,4d or '/NisLdapServer/!d will delete all the lines except for the 5th line and then the second part i am extracting the pattern inbetween the braces

awk '/NisLdapServer/ { print substr( $0, index($0, "(") + 1, index($0, ")") - ( index($0, "(") +1 ) ) }' filename
awk '/NisLdapServer/{
	n=split($NF,r ,"|")
	print r[1]
}' file

Thanks Guys Its working