How to get the value in the first brackets

Hello,

I am trying to write a script using ksh. And I want to get the value within the first brackets of a string. For example:

14/04/11 11:35: 00 This is (nn) from the earth.

Then i hope to get nn in this case.

Can any one advise me how to implement it?

Thank you very much!
nn

using Perl:

# echo "14/04/11 11:35: 00 This is (nn) from the earth." | perl -nl -e 'm/\((.*?)\)/; print $1;'
nn
#

Thank you Yogesh!
I tried your suggest with a string like below:

echo "13/04/11 12:09:05 NN 4 TEST1 TEST2: Name(NN) TEST3(string2) TEST4(string3) TEST5(string4) TEST6(string5) TEST7(string6) TEST8(string7) TEST9(string8)" | perl -nl -e

But I got:

/\((.*?)\)/: nested *?+ in regexp at /tmp/perl-eEPmcqa line 1.

Then i got a message:

'm/\((.*?)\)/; print $1;'

Is possible to use awk or sed to get NN within NAME()? The string can be very different. The purpose is to get the value within the first brackets.

Thank you very much!!!
nn

---------- Post updated at 06:18 AM ---------- Previous update was at 06:13 AM ----------

Sorry, it works!!! The previous error is a problem of the OS. Now it fixed and the command works.

Many thanks again, Yogesh!

Best Regards,
nn