The exec() method of regexp object search for a match in a specified string. Use it for example to get match in a specified string.
Syntax
regexObj.exec(str)
<HTML>
<TITLE>Example of Regexp Object</TITLE>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
var zip_exp = /(techstrikers )/;
var matches = zip_exp.exec('techstrikers world');
document.write(matches );
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
This will produce following result
techstrikers ,techstrikers