The exec Method

Learn about the exec method, which is called on RegExp objects by studying the example provided in this lesson.

Using the exec method

The exec method executes a search in a specified string to the full extent of the expression. This means that if there are capturing groups, they’ll also be taken into account.

Just like with ...