This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String str1 = new String("hello world"); | |
String str2 = new String("world hello"); | |
String str3 = new String("the world wryyyy"); | |
String regex = "^(?!.*hello)"; | |
Pattern p = Pattern.compile(regex); | |
System.out.println(p.matcher(str1).find()); // false | |
System.out.println(p.matcher(str2).find()); // false | |
System.out.println(p.matcher(str3).find()); // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String regex1 = "^hello"; | |
String str = new String("hello"); | |
Pattern p1 = Pattern.compile(regex1); | |
System.out.println(p1.matcher(str).matches()); // true | |
String regex2 = "[^hello]"; | |
Pattern p2 = Pattern.compile(regex2); | |
System.out.println(p2.matcher(str).matches()); // false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String regex = "^he"; | |
String s = new String("hello world"); | |
Pattern p = Pattern.compile(regex); | |
Matcher m = p.matcher(s); | |
System.out.println(m.find()); // => false | |
System.out.println(m.find()); // => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String regex = "^he"; | |
String s = new String("hello world"); | |
Pattern p = Pattern.compile(regex); | |
Matcher m = p.matcher(s); | |
System.out.println(m.matches()); // => false | |
System.out.println(m.find()); // => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pattern p = Pattern.compile("^he"); // Pattern.compile()的參數字串為正規表示式 | |
Matcher m = p.matcher("hello world"); // matcher()的參數為要查詢的字串 | |
System.out.println(m.find()); // 若查詢的字串的子字串符合正規表示式的規則,Matcher.find()回傳true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
嚴重: Servlet.service() for servlet [dispatcher] in context with path [/moneynote] threw exception [Request processing failed; nested exception is org.springframework.dao.DuplicateKeyException: StatementCallback; SQL [INSERT INTO tb_catg VALUES('測試類別001',NOW(),NOW())]; Duplicate entry '測試類別001' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '測試類別001' for key 'PRIMARY'] with root cause | |
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: | |
Duplicate entry '測試類別001' for key 'PRIMARY' | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
嚴重: Servlet.service() for servlet [dispatcher] in context with path [/moneynote] threw exception [Request processing failed; nested exception is org.springframework.dao.DuplicateKeyException: StatementCallback; SQL [INSERT INTO tb_catg VALUES('測試類別001' ,NOW(),NOW())]; Duplicate entry '測試類別001' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '測試類別001' for key 'PRIMARY'] with root cause | |
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '測試類別001' for key 'PRIMARY' | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("input").click(function(){ | |
console.log($(this).val()); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<input type="button" value="A"/> | |
<input type="button" value="B"/> | |
<input type="button" value="C"/> | |
</body> | |
</html> |