Releases: sharplet/Regex
Releases · sharplet/Regex
MetaPods
Comments Enabled
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
andRange<String.Index>
. This should improve performance and potentially correctness! (#69)
It Just Feels Better
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
Regex now speaks Swift 4! 🎉
Added:
- The
Regex
type now conforms toCodable
, so you can encode and decode regular expressions to your heart's content. (#52) MatchResult
has a newrange
property. (#54, thanks @mezhevikin!)- To go with
MatchResult.range
, there's also thecaptureRanges
property, allowing you to work with the ranges of capture groups. (#59)
Fixed:
- Regex now handles the newly overhauled String index API, maintaining that sweet, sweet Unicode correctness, whatever your chosen Swift version. (#57, 7952bae, 1a90514, thanks @wspl!)
Thanks for using Regex!
1.0.0: A Regex for the future
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!
0.4.3
0.4.2
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.
0.4.1
Added:
- New
DotMatchesLineSeparator
option allows.
to match new line characters such as\n
. Thanks @ninjaprawn!
Fail Me...Maybe?
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 aStaticString
instead of aString
(meaning that the string must exist statically at compile time), and will trap if an invalid pattern is provided. For dynamically created strings, useRegex.init(string:)
instead.
Removed:
Regex
no longer conforms toStringLiteralConvertible
. UseRegex.init(_:)
instead.
Regex now supports Xcode 8 and Swift 2.3!
Replaceable
Added
- New
String
methods for performing find and replace operations (#31)replaceFirstMatching(_:with:)
- replaces the first match of the given regex with the replacement templatereplaceAllMatching(_: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)