title: How to split an string into pairs of numbers?
body: <p>I am using a <code>regex</code> to extract telephone numbers, I achieve to extract the number from a text, however, I need the final output:</p>
  
  <pre><code>50 40 60 55 85
  </code></pre>
  
  <p>I tried as follows:</p>
  
  <pre><code>function extract_number(string){
    const regex = /(?:(\+?\d{1,3}) )?(?:([\(]?\d+[\)]?)[ -])?(\d{1,5}[\- ]?\d{1,5})/
    let value;
    try {
      const result = string.match(regex)
      value = result[0]
    } catch (err) {
      console.error('There was an error, the string don', err);
    }
  
      for (var i=0; i &lt; value.length; i++) { 
       //console.log(value.charAt(i));
       var temporal =  value.charAt(i)
       var final = temporal + ' '
       console.log(final)
      }
  
  }
  </code></pre>
  
  <p>However, when I run my function as follows:</p>
  
  <pre><code>extract_number('my number is 5540605585')
  </code></pre>
  
  <p>I only got:</p>
  
  <pre><code>node index.js 
  5 
  5 
  4 
  0 
  6 
  0 
  5 
  5 
  8 
  5 
  &lt;Buffer 68 6f 6c 61 20 6d 75 6e 64 6f&gt;
  </code></pre>
  
  <p>So I would like to appreciate support to achieve the task, additionally I do not know why I am getting: </p>
  
  <pre><code> &lt;Buffer 68 6f 6c 61 20 6d 75 6e 64 6f&gt;
  </code></pre>