Construct a regex for extracting names from a given string
'Jayden, Malcolm, and Jimmy went to school'
regex = r'[A-Z][a-z]+(?:, [A-Z][a-z]+)*(?: and)? [A-Z][a-z]+'
Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:
Construct a regex for extracting names from a given string

### Response:
regex = r'[A-Z][a-z]+(?:, [A-Z][a-z]+)*(?: and)? [A-Z][a-z]+'