---
title: CharacterClass
framework: regexbuilder
role: symbol
role_heading: Structure
path: regexbuilder/characterclass
---

# CharacterClass

A class of characters that match in a regex.

## Declaration

```swift
struct CharacterClass
```

## Overview

Overview A character class can represent individual characters, a group of characters, the set of character that match some set of criteria, or a set algebraic combination of all of the above.

## Topics

### Instance Properties

- [inverted](regexbuilder/characterclass/inverted.md)

### Instance Methods

- [intersection(_:)](regexbuilder/characterclass/intersection(_:).md)
- [subtracting(_:)](regexbuilder/characterclass/subtracting(_:).md)
- [symmetricDifference(_:)](regexbuilder/characterclass/symmetricdifference(_:).md)
- [union(_:)](regexbuilder/characterclass/union(_:).md)

### Type Methods

- [generalCategory(_:)](regexbuilder/characterclass/generalcategory(_:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [RegexComponent](swift/regexcomponent.md)

## See Also

### Components

- [Anchor](regexbuilder/anchor.md)
- [Lookahead](regexbuilder/lookahead.md)
- [NegativeLookahead](regexbuilder/negativelookahead.md)
- [ChoiceOf](regexbuilder/choiceof.md)
