I just need to make sure 2 words are entered into a text field. The words can contain any character with any number of spaces in between them. So essentially this format:
<word><any number of spaces><word>
In tried the following and it returns not null for more than 2 words:
'Hello world Something'.match(/(.*){1}\s(.*){1}/)
Any idea what the right REGEX will look like?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.