The exec() method returns the matched text if it finds a match, otherwise it returns null.

Click the button to search a string for the character "e".