code: private static Class findTargetClass( String key, Map classMap ) {
        // try get first
        Class targetClass = (Class) classMap.get( key );
        if( targetClass == null ){
           // try with regexp
           // this will hit performance as it must iterate over all the keys
           // and create a RegexpMatcher for each key
           for( Iterator i = classMap.entrySet()
                 .iterator(); i.hasNext(); ){
              Map.Entry entry = (Map.Entry) i.next();
              if( RegexpUtils.getMatcher( (String) entry.getKey() )
                    .matches( key ) ){
                 targetClass = (Class) entry.getValue();
                 break;
              }
           }
        }
  
        return targetClass;
     }
docs: Locates a Class associated to a specifi key.<br>
  The key may be a regexp.