Monday, December 17, 2007

sql: querying date column

select * from TABLE_NAME
where
COLUMN_NAME > TO_DATE('2007-12-07 23:59:05','yyyy-mm-dd HH24:mi:SS')

Thursday, October 25, 2007

java: Short regular expression tutorial

^ = logical not

\w = shortcut for alphanumeric. i.e. a-z, A-Z, 0-9, _

- = dash

. = full stop

space bar pressed here = space bar

[\\w-. ] = regular expression for valid characters.

[^\\w-. ] = regular expression for not valid characters (i.e.invalid characters).


//find a character that is not valid (ie. invalid characters are a-z, A-Z, 0-9, _, dash, full stop, and space bar

String regex = "[^\\w-. ]";

---------------------------------------------------------

Below are the common symbols you will often find:

^ The beginning of the line.

$ The end of the line.

. Any single character.

* Zero or more repetitions of the previous expression.

+ One or more repetitions of the previous expression.

[] Any of the characters inside the brackets will match—e.g., [abc] matches any of a, b, c. Ranges are allowed too—e.g., [a-z].