The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
Improves the CocoaPods spec metadata by explicitly annotating the license file as "MIT". Thanks @AlexeyVasilyevRN!
Comments Enabled
5 years ago
New:
- Adds a new option regex option `.allowCommentsAndWhitespace`, allowing for richer, self-documenting regular expression patterns. (#66 — thanks @remithaunay!)
Improved:
- Updated internals to use the modern built in conversions between `NSRange` and `Range<String.Index>`. This should improve performance and potentially correctness! (#69)
It Just Feels Better
5 years ago
Say hello to Regex version 2, including support for Swift 5! This release adds **no new functionality**, but drops support for Swift versions less than 4.2. Regex 2 should otherwise be fully compatible with Regex 1.1.
Swift Fourtification
6 years ago
Regex now speaks Swift 4! 🎉
**Added:**
- The `Regex` type now conforms to `Codable`, so you can encode and decode regular expressions to your heart's content. (#52)
- `MatchResult` has a new `range` property. (#54, thanks @mezhevikin!)
- To go with `MatchResult.range`, there's also the `captureRanges` property, allowing you to work with the ranges of capture groups. (#59)
**Fixed:**
- Regex now handles the newly [overhauled String index API](https://github.com/apple/swift-evolution/blob/master/proposals/0180-string-index-overhaul.md), maintaining that sweet, sweet Unicode correctness, whatever your chosen Swift version. (#57, 7952baebc8cf08597c2810496b7e777e6212be00, 1a90514f101436f8f92f06e4c5796e8e58458285, thanks @wspl!)
Thanks for using Regex!
1.0.0: A Regex for the future
6 years ago
Regex is now officially at 1.0.0! 🎉
Here's a quick hit list of features:
- Easily and safely create regular expressions
- When creating a regular expression from a static string, no error handling required
- Great pattern-matching support via `Regex.lastMatch`
- Type safe access to capture groups
- Convenient extensions to `String` to support find and replace
I hope you enjoy using Regex!
Fixes a build failure when using Swift Package Manager.
This should add full Swift 3 support for swiftpm and CocoaPods users. Carthage users should be able to opt into Swift 3 using the `--toolchain` option to `carthage build`.
Breaking changes to drop Swift 2 support and adopt the Swift API Design Guidelines will be made in a future release.
Added:
- New `DotMatchesLineSeparator` option allows `.` to match new line characters such as `\n`. Thanks @ninjaprawn!
Fail Me...Maybe?
7 years ago
Added:
- New initialiser `Regex.init(string:)` that throws if the pattern is invalid. Previously it wasn't possible to recover from this scenario.
Changed:
- The existing `Regex.init(_:)` initialiser now accepts a `StaticString` instead of a `String` (meaning that the string must exist statically at compile time), and will trap if an invalid pattern is provided. For dynamically created strings, use `Regex.init(string:)` instead.
Removed:
- `Regex` no longer conforms to `StringLiteralConvertible`. Use `Regex.init(_:)` instead.
Regex now supports Xcode 8 and Swift 2.3!
### Added
- New `String` methods for performing find and replace operations (#31)
- `replaceFirstMatching(_:with:)` - replaces the first match of the given regex with the replacement template
- `replaceAllMatching(_:with:)` - replaces all matches of the given regex with the replacement template
- Non-muting versions of each method for convenience
- New `Regex.lastMatch` static property that gives access to the last match result when pattern matching (#27)