From 63c24c4c7e25bdf794de01157523397a9280df92 Mon Sep 17 00:00:00 2001 From: evanljp Date: Fri, 11 May 2018 12:08:48 +0800 Subject: [PATCH] reapired the mistake ,which is the regular expression can inut a nill string --- notes/剑指 offer 题解.md | 1 + 1 file changed, 1 insertion(+) diff --git a/notes/剑指 offer 题解.md b/notes/剑指 offer 题解.md index 5e2b2553..8593f936 100644 --- a/notes/剑指 offer 题解.md +++ b/notes/剑指 offer 题解.md @@ -1017,6 +1017,7 @@ public boolean match(char[] str, char[] pattern) { ```java public boolean isNumeric(char[] str) { + if(str.length==0||str==null) return false; return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?"); } ```