How to accept space in regex?

I have this regex:

const name_regex = /^[a-zA-Z]+$/;

I tested this with the following regex tool

link

Can you please tell me how to do to accept and space?

Accept eg: John Smith

Thanks in advance!

Leave a Comment