 // SOFTWARE.
 
 @_exported import C7
-@_exported import OperatingSystem
+
+#if os(Linux)
+    @_exported import Glibc
+#else
+    @_exported import Darwin.C
+#endif
 
 struct RegexError: ErrorProtocol {
     let description: String
 
-    static func errorFromResult(result: Int32, preg: regex_t) -> RegexError {
+    static func error(from result: Int32, preg: regex_t) -> RegexError {
         var preg = preg
         var buffer = [Int8](repeating: 0, count: Int(BUFSIZ))
         regerror(result, &preg, &buffer, buffer.count)

        let result = regcomp(&preg, pattern, options.rawValue)

        if result != 0 {
            throw RegexError.errorFromResult(result, preg: preg)
        }
    }


        return true
    }

    public func groups(_ string: String, options: MatchOptions = []) -> [String] {
        var string = string
        let maxMatches = 10
        var groups = [String]()
