public static String qualifyPatternString( String pattern )
	{
		pattern = StringTool.strip( pattern, "*" );
		pattern = StringTool.strip( pattern, "_(" );    // width placeholder
		pattern = StringTool.strip( pattern, "_)" );    // width placeholder
		pattern = StringTool.strip( pattern, "_" );
		pattern = pattern.replaceAll( "\"", "" );
		pattern = StringTool.strip( pattern, "?" );
		// there are more bracketed expressions to deal with
		// see http://office.microsoft.com/en-us/excel-help/creating-international-number-formats-HA001034635.aspx?redir=0
		//pattern = StringTool.strip(pattern, "[Red]");	// [Black]  [h] [hhh] [=1] [=2]
		//pattern = StringTool.strip(pattern, "Red]");
		// TODO: implement locale-specific entries:  [$-409] [$-404] ... ********************
//        pattern= pattern.replaceAll("\\[.+?\\]", "");
/*        if (s.length > 1) {
        	System.out.println(s[0]);
        	java.util.regex.Pattern p = java.util.regex.Pattern.compile("\\[(.*?)\\]");
        	java.util.regex.Matcher m = p.matcher(pattern);

        	while(m.find()) {
        	    System.out.println(m.group(1));
        	}        	
        }*/
		String[] s = pattern.split( "\\[" );
		if( s.length > 1 )
		{
			pattern = "";
			for( String value : s )
			{
				int zz = value.indexOf( "]" );
				if( zz != -1 )
				{
					String term = value.substring( 1, zz );    // skip first $
					if( term.indexOf( "-" ) != -1 )
					{ // extract character TODO: locale specifics
						pattern += term.substring( 0, term.indexOf( "-" ) );
					}
				}
				pattern += value.substring( zz + 1 );
			}
		}
		return pattern;
	}