I have written a code on a Linux box, however, am getting issues while running it on a Solaris server. The issue with Sed command is sortd out, however, am still lokking for solutions with expr command. Here is the issue,
Linux :
bash-2.03$ expr match singh@test.com '\(^[a-zA-Z0-9\w\.\_\-]*@[Tt][Ee][Ss][Tt].[Cc][Oo][Mm]$\)'
singh@test.com
bash-2.03$
Solaris :
bash-2.03$ expr match singh@test.com '\(^[a-zA-Z0-9\w\.\_\-]*@[Tt][Ee][Ss][Tt].[Cc][Oo][Mm]$\)'
bash-2.03$
The output in solaris is blank. Could anyone please let me know what changes can I make in this command to make it work.
Test your i/ps with this . "-i" stands for case-insensitive. so it makes your regex less ugly. code your stuffs in perl if you want them portable would be my advise.
Thanks for the suggestion. Am not familiar with Perl Scripting, however, now I am plannig to study it as well. Could you please let me know how can I make exact pattern match, for instance singh@test.coms should not be matched. (there is an extra "s" after com).
---------- Post updated at 06:53 AM ---------- Previous update was at 06:51 AM ----------
@ ygemici ... thanks for the reply ... though this will not give an exact match, see the below one
bash-2.03$ expr match singh@test.comtest '\([a-zA-Z0-9\w\.\_\-]*@[Tt][Ee][Ss][Tt].[Cc][Oo][Mm]\)' singh@test.com
bash-2.03$
---------- Post updated at 01:15 PM ---------- Previous update was at 01:13 PM ----------
Hey Gaurav,
I guess S+ would allow only alphabets to be matched ... I need a regex which would allow a combination "-, _, ., alphabets and numerals" as input for email address.
---------- Post updated at 01:20 PM ---------- Previous update was at 01:15 PM ----------
Hey Ripat,
Am getting following error while using grep command,