package test.info.dragonlady.scriptlet;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import junit.framework.TestCase;

public class TestAny extends TestCase {
	
	public void test1() {
//		String test = "<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
//		String test = "<META http-equiv=\"Content-Type\" content=\"text/html; charset=euc_jp\">";
//		String test = "<META http-equiv=\"Content-Type\" content=\"text/html; charset=shift-Jis\">";
		String test = " charset=UTF-8  ";
		String metaCharsetValue = test.substring(test.toLowerCase().indexOf("charset=")+"charset=".length());
		Pattern p = Pattern.compile("(^[a-zA-Z0-9\\-_]+).*");
		Matcher m = p.matcher(metaCharsetValue);
		if(m.matches()) {
			System.out.println(m.group(1));
		}
	}

}
