Skip to main content
Regexflux

Password Without Spaces

beginner

Validates passwords that contain no whitespace characters.

passwordvalidationwhitespace

Pattern

/^\S{8,}$/

Try It

0 of 7 strings matched

Explanation

Matches 8 or more non-whitespace characters from start to end. Rejects any password containing spaces, tabs, or other whitespace.

Test Strings

Matching

  • NoSpaces1!
  • tight_password
  • P@$$w0rd

Non-matching

  • has space
  • tab here
  • short

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /^\S{8,}$/;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns