Enterprise Software Security: A Confluence of Disciplines (Elton Dasho's Library) by Kenneth R. van Wyk & Mark G. Graff & Dan S. Peters & Diana L. Burley

Enterprise Software Security: A Confluence of Disciplines (Elton Dasho's Library) by Kenneth R. van Wyk & Mark G. Graff & Dan S. Peters & Diana L. Burley

Author:Kenneth R. van Wyk & Mark G. Graff & Dan S. Peters & Diana L. Burley
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2015-07-14T16:00:00+00:00


* * *

import java.io.Console;

import java.util.regex.Matcher;

import java.util.regex.Pattern;

/* A validation class that uses Java regex to validate input fields and

* implement a primitive (and easily bypassed!) blacklist filter against

* XSS and SQL Injection

*/

public class Ch4Validation {

// Regular expressions for fields validation

public static String REGEX_EMAIL = "^\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,}$";

public static String REGEX_DATE = "^\\d{1,2}\\/\\d{1,2}\\/\\d{2,4}$";

public static String REGEX_24TIME = "^(([0-1][0-9])|([2][0-3])):([0-5][0-9])(:([0-5][0-9]))?$";



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.