         #endif
     }
     
-    internal func replace(_ regex: String, with replacement: String) -> String {
+    public func replace(_ regex: String, with replacement: String) -> String {
         var result = self
         
         let matches = self.matches(regex: regex)

// MARK: - Convenience for optional strings.
extension Optional where Wrapped: ExpressibleByStringLiteral {
    /// Falls back to an empty string if no value is found.
    internal var safeUnwrap: String {
        guard let string = self as? String else {
            return ""
        }

    ///
    /// - Parameter regex: Regex to check for.
    /// - Returns: Returns the match (if any).
    public func firstMatch(regex: String) -> String? {
        guard let range = self.range(of: regex, options: .regularExpression) else {
            return nil
        }
