[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Mon Sep 27 21:26:54 UTC 2004


kawas
Mon Sep 27 17:26:54 EDT 2004
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/gui/util
In directory pub.open-bio.org:/tmp/cvs-serv20410/org/biomoby/client/gui/util

Modified Files:
	REGEXP.java 
Log Message:


moby-live/Java/src/main/org/biomoby/client/gui/util REGEXP.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/gui/util/REGEXP.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/gui/util/REGEXP.java	2004/09/27 21:06:17	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/gui/util/REGEXP.java	2004/09/27 21:26:54	1.3
@@ -5,62 +5,56 @@
 
 /**
  * 
- * @author Edward Kawas
- *         <P>
- *         This class provides the methods necessary to validate email
- *         addresses,
- *         <p>
- *         URLs, and URIs.
+ * @author Eddie Kawas
+ * <p>Created for the Biomoby Project
+ * <p>This class was created to provide the necessary methods to validate email addresses
+ * <p>URLs, and URIs.
+ * <p>For questions, comments, or bugs
+ * <p>email me at edward.kawas at gmail.com
  */
-
 public class REGEXP {
 
-    /*
-     * regular expressions used for validation.
-     */
-    private final static String EMAIL = "(^[\\w]+\\+?\\w*(\\.[\\w]+)*@[\\w]{2,}\\.[\\w]{2,}(\\.[\\w]{2,})*$)";
-
-    private final static String URI = 
-    //"(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|www\\.|http:\\/\\/|HTTP:\\/\\/)?[\\w]+\\.[\\w].*\\w$)";
-    //"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"; // as per
-    // rfc 2396 appendix a.
-    "^([\\w]+\\.[\\w]+(\\.[\\w]+)*)$";
-
-    private final static String URL = "(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|http:\\/\\/|HTTP:\\/\\/)[\\w]+\\.[\\w].*(\\/\\w+(\\.{1}\\w+)*)$)";
-
-    /**
-     * 
-     * @param address -
-     *            the string to validate.
-     * @return true is address is a valid email address, false otherwise.
-     */
-    public static boolean isValidEmailAddress(String address) {
-        Pattern p = Pattern.compile(EMAIL);
-        Matcher m = p.matcher(address);
-        return m.matches();
-    }
-
-    /**
-     * 
-     * @param uri -
-     *            the string to validate.
-     * @return true if the uri is a valid uri, false otherwise.
-     */
-    public static boolean isValidURI(String uri) {
-        Pattern p = Pattern.compile(URI);
-        Matcher m = p.matcher(uri);
-        return m.matches();
-    }
-
-    /**
-     * 
-     * @param url -
-     *            the string to validate.
-     * @return true if url is a valid URL, false otherwise.
-     */
-    public static boolean isValidURL(String url) {
-        Pattern p = Pattern.compile(URL);
-        Matcher m = p.matcher(url);
-        return m.matches();
-    }
+	/*
+	 * regular expressions used for validation.
+	 */
+	private final static String EMAIL = "(^[\\w]+\\+?\\w*(\\.[\\w]+)*@[\\w]{2,}\\.[\\w]{2,}(\\.[\\w]{2,})*$)";
+	private final static String URI =
+		//"(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|www\\.|http:\\/\\/|HTTP:\\/\\/)?[\\w]+\\.[\\w].*\\w$)";
+		//"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"; // as per rfc 2396 appendix a.
+	    "^([\\w]+\\.[\\w]+(\\.[\\w]+)*)$";
+	private final static String URL =
+		"(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|http:\\/\\/|HTTP:\\/\\/)[\\w]+\\.[\\w].*(\\/\\w+(\\.{1}\\w+)*)$)";
+	
+	/**
+	 * 
+	 * @param address - the string to validate.
+	 * @return true is address is a valid email address, false otherwise.
+	 */
+	public static boolean isValidEmailAddress(String address) {
+		Pattern p = Pattern.compile(EMAIL);
+		Matcher m = p.matcher(address);
+		return m.matches();
+	}
+
+	/**
+	 * 
+	 * @param uri - the string to validate.
+	 * @return true if the uri is a valid uri, false otherwise.
+	 */
+	public static boolean isValidURI(String uri) {
+		Pattern p = Pattern.compile(URI);
+		Matcher m = p.matcher(uri);
+		return m.matches();
+	}
+
+	/**
+	 * 
+	 * @param url - the string to validate.
+	 * @return true if url is a valid URL, false otherwise.
+	 */
+	public static boolean isValidURL(String url) {
+		Pattern p = Pattern.compile(URL);
+		Matcher m = p.matcher(url);
+		return m.matches();
+	}
 }
\ No newline at end of file




More information about the MOBY-guts mailing list