Regex To Match Any Word In A String Excluding Spaces

A regular expression to match any word in a string until meeting spaces.

/([^\s]+)/

Matches:

  • This Is Word

Non-matches:

  • Any spaces found in a string

See Also:

Regex Is Copied!