編集の要約なし |
編集の要約なし |
||
2行目: | 2行目: | ||
public boolean matches(String regex) | public boolean matches(String regex) | ||
正規表現を利用して指定文字列と一致するか真偽します。 | |||
if (s.matches("ho[gbw]e")) { | if (s.matches("ho[gbw]e")) { | ||
System.out.println("It matches!"); | System.out.println("It matches!"); | ||
} | } |