- 2008 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2007 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2006 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2005 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2004 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2003 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2002 : 01 02 03 04 05 06 07 08 09 10 11 12
2004-03-15
正規表現 (Pattern, Matcherクラス)
- マッチング
- 置換
- 分割
- 注意
を忘れずに
- Reference
JavaAPI Documents - Pattern (Java 2 プラットフォーム SE v1.4.0)
http://java.sun.com/j2se/1.4/ja/docs/ja/api/java/util/regex/Pattern.html
JavaでHello World 正規表現編
http://www.hellohiro.com/regex.htm
boolean flag = Pattern.matches("正規表現","文字列");
- 置換
Pattern p = Pattern.compile("正規表現"); Matcher m = p.matcher("置換対象文字列"); String result = m.replaceFirst("置換文字列"); String result = m.replaceAll("置換文字列");
- 分割
Pattern p = Pattern.compile("正規表現"); String[] strs = p.split("置換対象文字列");
- 注意
import java.util.regex.*;を忘れずに
- Reference
JavaAPI Documents - Pattern (Java 2 プラットフォーム SE v1.4.0)
http://java.sun.com/j2se/1.4/ja/docs/ja/api/java/util/regex/Pattern.html
JavaでHello World 正規表現編
http://www.hellohiro.com/regex.htm
- 2008 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2007 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2006 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2005 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2004 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2003 : 01 02 03 04 05 06 07 08 09 10 11 12
- 2002 : 01 02 03 04 05 06 07 08 09 10 11 12
2004-03 /