---
title: "symmetricDifference(_:)"
framework: regexbuilder
role: symbol
role_heading: Instance Method
path: "regexbuilder/characterclass/symmetricdifference(_:)"
---

# symmetricDifference(_:)

Returns a character class matching elements in one or the other, but not both, of this class and the given class.

## Declaration

```swift
func symmetricDifference(_ other: CharacterClass) -> CharacterClass
```
