   See https://docs.python.org/2/library/re.html#re.compile
   
   :param: pattern regular expression pattern string
-  :param: flags   Array of NSRegularExpressionOptions objects
+  :param: flags   NSRegularExpressionOptions value
   
   :returns: The created RegexObject object. If the pattern is invalid, RegexObject.isValid is false, and all methods have a default return value.
   */
-  public static func compile(pattern: String, flags: [RegexObject.Flag] = []) -> RegexObject  {
+  public static func compile(pattern: String, flags: RegexObject.Flag = []) -> RegexObject  {
     return RegexObject(pattern: pattern, flags: flags)
   }
   

  :param: repl    replacement string
  :param: string  string to be searched and replaced
  :param: count   maximum number of times to perform replace operations to the string
  :param: flags   Array of NSRegularExpressionOptions objects
  
  :returns: replaced string
  */
  public static func sub(pattern: String, _ repl: String, _ string: String, _ count: Int = 0, flags: [RegexObject.Flag] = []) -> String {
    return re.compile(pattern, flags: flags).sub(repl, string, count)
  }
  

      let end = endpos ?? string.characters.count
      let length = max(0, end - start)
      let range = NSRange(location: start, length: length)
      return regex.matchesInString(string, options: [], range: range).map { MatchObject(string: string, match: $0) }
    }
    
    /**
