⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpregex.java

📁 RFC 1945 Http1.0协议实现。对协议进行了完整面向对象设计
💻 JAVA
字号:
/**
 * 
 */
package edu.sysu.http.util;

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

/**
 * @author Administrator
 *
 */
public class HttpRegex {
	
	private Pattern pattern;
	private String strPattern = null;
	
	/**
	 * 
	 */
	public HttpRegex() {
		// TODO Auto-generated constructor stub
	}
	
	public HttpRegex(String pattern) {
		// TODO Auto-generated constructor stub
		this.SetPattern(pattern);
	}
	
	public void SetPattern(String pattern)
	{
		this.setStrPattern(pattern);
		this.pattern = Pattern.compile(this.getStrPattern());
	}
	
	public boolean Match(String strMatch)
	{
		return this.pattern.matcher(strMatch).matches();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	/**
	 * @param strPattern the strPattern to set
	 */
	private void setStrPattern(String strPattern) {
		if(strPattern != null)
			this.strPattern = strPattern;
	}

	/**
	 * @return the strPattern
	 */
	public String getStrPattern() {
		return strPattern;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -