I am new to regex. I am checking email ids using regex.
Following is my code to match <xyz@xyz.com>
with xyz@xyz.com
Pattern p = Pattern.compile("\\<(.*?)\\>");
Matcher m = p.matcher("<xyz@xyz.com>");
And its working fine. Now I want to match either <xyz@xyz.com>
or [xyz@xyz.com]
with xyz@xyz.com
.
Any suggestion will be appreciated.