/

HTML / CSS / JavaScript Tutorial

JavaScript regular expression method: exec()

[this page | pdf | back links]

The exec() method (when applied to a JavaScript regular expression) seeks a match in a string and returns the first match.

 

It has the following syntax with the following parameters. It returns a string as above, or null if no such string is found.

 

RegExprObject.exec(string)

 

Parameter

Required / Optional

Description

string

Required

The string to be searched

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript Regular Expressions


Desktop view | Switch to Mobile