Regular Expressions 101

Sponsor⁠s

Community Library

Community Library Entry

0

Regular ExpressionOpen Workspace

/
\s+
/
g

Description
Created·2022-03-24 00:10
Type·Match
Flavor·JavaScript

match one or more contiguous white space characters in a string.
can be used in JS, for example, to replace any white space characters (tab, space, newline), as well as multiple contiguous WS chars, with a single space character. var text = “1 2 \t \n 3”; text = text.replace(/\s+/g, ' '); // result: text == ‘1 2 3’

Submitted by Anonymous
Open Workspace