         // The searched string.
         public var searched: String { return match.searched }
         
-        // The range in the searched string.
-        public var range: Range<String.Index>? {
-            return match.result.range(at: index).toRange(in: searched)
-        }
+        var nsRange: NSRange { return match.result.range(at: index) }
         
         init(index: Int, match: Match) {
             self.match = match

    
    
    /// A type thats represents capture group in a match.
    public struct CaptureGroup : MatchProtocol {
        
        // The index in the match.
        public let index: Int
        

    /// The wrapped NSTextCheckingResult.
    public let result: NSTextCheckingResult
    
    var nsRange: NSRange {
        return result.range
    }
    
    init?(searched: String, result: NSTextCheckingResult, regex: Regex) {
        self.searched = searched
        self.result = result
