JSFiddle - React, Tailwind, and code Playground

by Kristian Jabilles

JavaScript

let regex = /^[\w-]+$/;

console.log( 'test-test'.replace(regex, ' ') )