---
title: whitespace
framework: swift
role: symbol
role_heading: Type Property
path: swift/regexcomponent/whitespace
---

# whitespace

A character class that matches any element that is classified as whitespace.

## Declaration

```swift
static var whitespace: CharacterClass { get }
```

## Discussion

Discussion This character class is equivalent to \s in regex syntax.

## See Also

### Matching whitespace and line endings

- [horizontalWhitespace](swift/regexcomponent/horizontalwhitespace.md)
- [newlineSequence](swift/regexcomponent/newlinesequence.md)
- [verticalWhitespace](swift/regexcomponent/verticalwhitespace.md)
