code: public static int regexFlags(final String s) {
          int flags = 0;
  
          if (s == null) {
              return flags;
          }
  
          for (final char f : s.toLowerCase().toCharArray()) {
              flags |= regexFlag(f);
          }
  
          return flags;
      }
docs: Converts a sequence of regular expression modifiers from the database into Java regular expression flags.
  
  @param s regular expression modifiers
  @return the Java flags
  @throws IllegalArgumentException If sequence contains invalid flags.