Skip to content

Instantly share code, notes, and snippets.

View Xerosigma's full-sized avatar
💻
Making Things Happen

Nestor E. Ledon Xerosigma

💻
Making Things Happen
View GitHub Profile
@Xerosigma
Xerosigma / Page.java
Created September 8, 2014 15:50
HATEOAS Resouce
package com.provider.spring.rest;
public class Page {
private int size;
private int totalElements;
private int totalPages;
private int number;
public Page() {}
@Xerosigma
Xerosigma / gist:8979693
Last active August 29, 2015 13:56
Regex
// Five or nine digit U.S. zipcodes.
public static final String REGEX_ZIP = "[^\\d{5}([\\-]?\\d{4})?$]";
// Dates: 12/31/2014
public static final String REGEX_DATE = "^(0[1-9]|1[012])[- \\/.](0[1-9]|[12][0-9]|3[01])[- \\/.](19|20)\\d\\d$";
// Dates: 2014/12/31
public static final String REGEX_DATE_DATA = "^(19|20)\\d\\d[- \\/.](0[1-9]|1[012])[- \\/.](0[1-9]|[12][0-9]|3[01])$";
// Integers