A delightful and expressive regular expression type for Swift with pattern matching, capture groups, and Codable support.
Regex is a Swift library that provides a type-safe, expressive interface for working with regular expressions. It solves the problem of cumbersome string-based regex APIs by offering pattern matching in switch statements, easy capture group access, and full Codable support for serialization.
Swift developers working on iOS, macOS, or server-side applications who need to perform text parsing, validation, or pattern matching with regular expressions.
Developers choose Regex over native Swift regex APIs because it provides a more expressive, type-safe interface with pattern matching integration, capture group utilities, and Codable support that feels native to the Swift language.
A delightful and expressive regular expression type for Swift.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates regex directly into Swift switch statements and supports Codable for JSON serialization, making it feel native, as shown in the pattern matching and decode examples.
Provides easy-to-use properties like captures and captureRanges for extracting matched substrings, simplifying text parsing without manual range handling.
Supports common regex options such as case-insensitive and multiline matching through the options parameter, enabling adaptable text processing.
Available on all Swift platforms via Swift Package Manager, Carthage, and CocoaPods, with compatibility from Swift 4.2 upward, ensuring wide usability.
Constructing regexes from dynamic strings requires explicit error handling with try-catch, adding boilerplate code and complexity for untrusted inputs.
Limited to Swift projects, making it irrelevant for cross-platform or multi-language codebases where regex logic needs to be shared.
As an abstraction layer over native regex APIs, it may introduce slight performance penalties compared to direct usage, though not explicitly documented.