Code-Samples/javascript/40.7_regexp_code.html exec() method returns text matched with given pattern.