---
title: "java正则 - 日期"
author: "wing123"
date: "2013-08-23T17:56:12Z"
tags: []
categories: ["移动开发"]
slug: "java"
draft: false
lastmod: "2013-08-23T17:56:12Z"
id: 1930177
url: "https://wing123.iteye.com/blog/1930177"
---

```
String p = "^\\d{4}-\\d{2}-\\d{2}$";
String d = "ss";
boolean isCheck = Pattern.matches(p, d);//2013-08-09 : true,  ss : false
```