 // 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)

        regfree(&preg)
    }

    public func matches(string: String, options: MatchOptions = []) -> Bool {
        var regexMatches = [regmatch_t](repeating: regmatch_t(), count: 1)
        let result = regexec(&preg, string, regexMatches.count, &regexMatches, options.rawValue)


        return true
    }

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