I have more strings split by 2 spaces , something like:
abc adfdfg aefdf xcv
^^ ^^ ^^
What is the correct regular expression to retrieve that strings.
Thanks.
LE: what i tried is : split(/[a-zA-Z\-]\s{2}/); and it is not working
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assume your string to be declared using
var string = 'abc adfdfg aefdf xcv'. Then use:string = string.split(/\s{2,}/);returns a list of substrings, split by at least two white-space characters (including tabs and newlines). If you only want to split spaces, use(space) instead of\s.