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

# hexDigit

A character class that matches any hexadecimal digit.

## Declaration

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

## Discussion

Discussion hexDigit matches the ASCII characters 0 through 9, and upper- or lowercase a through f. The corresponding characters in the “Halfwidth and Fullwidth Forms” Unicode block are not matched by this character class.

## See Also

### Matching substring sequences

- [anyOf(_:)](swift/regexcomponent/anyof(_:)-3pexl.md)
- [anyOf(_:)](swift/regexcomponent/anyof(_:)-4xgea.md)
- [any](swift/regexcomponent/any.md)
- [anyGraphemeCluster](swift/regexcomponent/anygraphemecluster.md)
- [anyNonNewline](swift/regexcomponent/anynonnewline.md)
- [digit](swift/regexcomponent/digit.md)
- [word](swift/regexcomponent/word.md)
