public static String regexFlags ( final int flags ) { int processedFlags = flags ; StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < FLAG_LOOKUP . length ; i ++ ) { if ( ( processedFlags & FLAG_LOOKUP [ i ] ) > 0 ) { buf . append ( ( char ) i ) ; processedFlags -= FLAG_LOOKUP [ i ] ; } } if ( processedFlags > 0 ) { throw new IllegalArgumentException ( "Some flags could not be recognized." ) ; } return buf . toString ( ) ; }
Converts Java regular expression flags into regular expression modifiers from the database .