JSFiddle - React, Tailwind, and code Playground

by bombo

JavaScript

var string = '   \r\n';
var pattern = /\S+/g;

alert(string.match(pattern));