-1
大家好我剛開始的正則表達式和執行的示例代碼找到正則表達式的功能在Java中
package practice;
import java.util.regex.*;
public class Regexpr2 {
public static void main(String args[])
{
Pattern pat = Pattern.compile("Java 7 naya hai") ;
Matcher match = pat.matcher("Java");
System.out.println("Here I am ------------>");
if (match.find())
System.out.println("got it using find method---------");
else
System.out.println("didnt got");
}
}
但我不是我所期待的輸出
enter code here
輸出:
這裏我是------------> 沒有得到
有人可以解釋爲什麼是「else」語句是開始摹excuted
請確保您的問題在發佈之前格式正確。謝謝。 –